#pragma once
#include <list>
#include <string>
#include <string.h>
#include "SSModel.h"

using namespace qb;
#ifndef __FIELDCOPY__
#if WIN32
#define __FIELDCOPY__(field,dest)	strncpy_s(field,_countof(field),dest,_TRUNCATE)
#else
#define __FIELDCOPY__(field,dest)	strncpy(field,dest, _countof(field))
#endif
#endif

class xHyIDBQuoteAnnounced_c;
//inner
//
//批量报价列表结构
//xHyIDBBatchQuoteListItem
class xHyIDBBatchQuoteListItem_c
{
	//2016/12/06 by devin.zhang: 因为增加了标书功能，所以增加字段m_BidDocPrice
public:
	//UUID
	tcUUID_c	m_UUID;							//记录的UUID，报价提交(55043)时不用，详情查询(55002)和更新(55031)时使用
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//Vol
	char		m_Vol[12];					    //面值
	//BidCoupon
	char		m_BidCoupon[12];				//投标票面，由前台计算得出，投标提交时后台入库；之后查询时不再计算，由后台提供
	//BidDocPrice
	char        m_BidDocPrice[12];                  //投标标位，在有标书时根据BidCoupon查表得出；没有标书时客户端发布为空。
	//2016/08/30 by devin.zhang:从pc端同名文件中移过来
	//Unit -add zxj PRIM-1213
	int			m_UnitV2;
	//BidCoupon -add zxj PRIM-1213
	char		m_BidCouponV2_y[12];			//投标票面V2，收益率/价格转化值，与m_BidCouponV2_p对应，提交到后台之后由后台计算出
	//BidCoupon -add zxj PRIM-1213
	char		m_BidCouponV2_p[12];			//投标票面V2，收益率/价格转化值，与m_BidCouponV2_y对应，提交到后台之后由后台计算出

	//SuExType
	int			m_SuExType;						//票面&综收，20160302添加。参见枚举QUOTE_SU_EX_TYPE的定义
	//SuDeliveryType
	int			m_SuDeliveryType;				//上市&分销，20160302添加。参见枚举QUOTE_SU_DELIVERY_TYPE的定义
	//SuReturnType
	int			m_SuReturnType;					//无返&单返&折返，20160302添加。参见枚举QUOTE_SU_RETURN_TYPE的定义
	//ExType
	int			m_ExType;						//补充信息，0:票面;1:综收
	//Coupon
	char		m_Coupon[12];					//票面数值
	//ReturnType
	int			m_ReturnType;					//选择票面后，选择是否单返。若选择票面则此项无意义。0:无返;1:单返
	//ReturnRate
	char		m_ReturnRate[12];				//单返数值
	//ComprehensiveIncome
	char		m_ComprehensiveIncome[12];		//综收数值
	//UpperLimit
	char		m_UpperLimit[12];				//上限，仅在选择综收时有效
	//Operation
	int			m_Operation;					//报价标志，0--未确认，1--已确认，2--已撤销
	//Time
	time_t		m_Time;							//价格最新时间，服务端时间
	//Source
	int			m_Source;						//当前记录来源，0为宏源录入，1为QB录入
	/*******************新增交割方式， QB2.6.0， Add by Lance ********************/
	//--交割方式。针对每一条交易，而不是分配列表。首先为TP版本使用。
	//DeliveryType
	//enum DeliveryTypeEnum
	//{
	//	DT_TYPE_5 = 5,//上市单返
	//	DT_TYPE_0 = 0,//上市折返
	//	DT_TYPE_1 = 1,//上市不返
	//	DT_TYPE_2 = 2,//分销单返
	//	DT_TYPE_3 = 3,//分销折返
	//	DT_TYPE_4 = 4,//分销不返
	//};
	int			m_DeliveryType;	//交割方式。
	//Comment
	char		m_Comment[32];					//备注，10个中文字
	/***************************************/
	//FunctionBegin
	//初始值
	xHyIDBBatchQuoteListItem_c()
	{
		memset(this, 0, sizeof(xHyIDBBatchQuoteListItem_c));
		m_DeliveryType = 4;
	}
	bool operator<(const xHyIDBQuoteAnnounced_c& that) const;
	bool operator==(const xHyIDBQuoteAnnounced_c& that) const;
	bool operator<(const xHyIDBBatchQuoteListItem_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)<0;
	}
	bool operator==(const xHyIDBBatchQuoteListItem_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)==0;
	}
	bool DeliveryTypeOld2New()
	{
		if(m_ExType == 0){//票面，6种
			if(m_ReturnType == 0){
				if(m_DeliveryType == 1){//票面上市不返
					m_SuExType = 1;
					m_SuDeliveryType = 1;
					m_SuReturnType = 1;
					return true;
				}
				else if(m_DeliveryType == 4){//票面分销不返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return true;
				}
				else{//无效
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return false;
				}
			}
			else if(m_ReturnType == 1){
				if(m_DeliveryType == 0){//票面上市折返
					m_SuExType = 1;
					m_SuDeliveryType = 1;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 2){//票面分销单返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 2;
					return true;
				}
				else if(m_DeliveryType == 3){//票面分销折返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 5){//票面上市单返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return true;
				}
				else{//无效
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return false;
				}
			}
			else{//无效
				m_SuExType = 1;
				m_SuDeliveryType = 2;
				m_SuReturnType = 1;
				return false;
			}
		}
		else if(m_ExType == 1){//综收，4种
			if(m_ReturnType == 1){
				if(m_DeliveryType == 0){//综收上市折返
					m_SuExType = 2;
					m_SuDeliveryType = 1;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 2){//综收分销单返
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 2;
					return true;
				}
				else if(m_DeliveryType == 3){//综收分销折返
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 5){//综收上市单返
					m_SuExType = 2;
					m_SuDeliveryType = 1;
					m_SuReturnType = 2;
					return true;
				}
				else{//无效
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return false;
				}
			}
			else{//无效
				m_SuExType = 2;
				m_SuDeliveryType = 2;
				m_SuReturnType = 3;
				return false;
			}
		}
		else{//无效
			m_SuExType = 2;
			m_SuDeliveryType = 2;
			m_SuReturnType = 3;
			return false;
		}
		return false;
	};
	bool DeliveryTypeNew2Old(){
		if(m_SuExType == 1){//票面
			if(m_SuDeliveryType == 1){//上市
				if(m_SuReturnType == 1){//无返
					m_ExType = 0;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 0;
					m_DeliveryType = 5;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 0;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}
				else{//默认,票面上市不返
					m_ExType = 0;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
			}
			else if(m_SuDeliveryType == 2){//分销
				if(m_SuReturnType == 1){//无返
					m_ExType = 0;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 0;
					m_DeliveryType = 2;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 0;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}
				else{//默认,票面分销不返
					m_ExType = 0;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
			}
		}
		else if(m_SuExType == 2){//综收
			if(m_SuDeliveryType == 1){//上市
				if(m_SuReturnType == 1){//无返
					m_ExType = 1;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 1;
					m_DeliveryType = 5;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 1;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}				
				else{//默认，综收上市折返
					m_ExType = 1;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}
			}
			else if(m_SuDeliveryType == 2){//分销
				if(m_SuReturnType == 1){//无返
					m_ExType = 1;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 1;
					m_DeliveryType = 2;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 1;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}				
				else{//默认，综收分销折返
					m_ExType = 1;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}
			}
		}
		return false;
	};
	//FunctionEnd
};
enum QUOTE_SU_EX_TYPE	//票面&综收
{
	QSET_INVALID				= 0,	//无效状态，未填写时的默认状态
	QSET_COUPON					= 1,	//票面
	QSET_COMPREHENSIVEINCOME	= 2		//综收
};
enum QUOTE_SU_DELIVERY_TYPE		//上市&分销
{
	QSDT_INVALID				= 0,	//无效状态，未填写时的默认状态
	QSDT_LISTED					= 1,	//上市
	QSDT_DISTRIBUTE				= 2		//分销
};
enum QUOTE_SU_RETURN_TYPE	//无返&单返&折返
{
	QSRT_INVALID				= 0,	//无效状态，未填写时的默认状态
	QSRT_NON_REBATE				= 1,	//无返
	QSRT_REBATE_INDEPENDENTLY	= 2,	//单返
	QSRT_REBATE_BY_DISCOUNT		= 3		//折返
};

enum _eBidType
{	//0 无效,1 投标区间，2 建议区间，3 发行结果，4 推迟发行，5 截标时间
	eBTInvalid = 0,
	eBTBidArea = 1,
	eBTSuggestArea = 2,
	eBTPublicationResult = 3,
	eBTDelayPublication = 4,
	eBTAuctionEndTime = 5
};
//inner
//
//宏源报价记录类（已公告，报价与修改、详情、申购窗口及自动更新使用。根据需求文档1.7，新增历史标位窗口，也使用此类）。
//xHyIDBQuoteAnnounced
class xHyIDBQuoteAnnounced_c
{
	//2016/12/06 by devin.zhang: 因为增加了标书功能，所以增加字段：m_BidDocPrice（标书对应的价格）、m_ReturnRateUnit（手续费单位）
	
public:
	//BondKeyO
	tcBondKey_c	m_BondKey;						//bondkey
	//ListedMarket
	tcListedMarket_c	m_ListedMarket;			//市场
	//UUID
	tcUUID_c	m_UUID;							//记录的UUID，报价提交(55000)时不用，详情查询(55002)和更新(55031)时使用
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//Vol
	char		m_Vol[12];					    //面值
	//BidCoupon
	char		m_BidCoupon[12];				//投标票面，由前台计算得出，投标提交时后台入库；之后查询时不再计算，由后台提供
	//BidDocPrice
	char        m_BidDocPrice[12];                  //投标标位，在有标书时根据BidCoupon查表得出；没有标书时客户端发布为空。
	//2016/08/30 by devin.zhang:从pc端同名文件中移过来
	//Unit -add zxj PRIM-1213
	int			m_UnitV2;
	//BidCoupon -add zxj PRIM-1213
	char		m_BidCouponV2_y[12];			//投标票面V2，收益率/价格转化值，与m_BidCouponV2_p对应，提交到后台之后由后台计算出
	//BidCoupon -add zxj PRIM-1213
	char		m_BidCouponV2_p[12];			//投标票面V2，收益率/价格转化值，与m_BidCouponV2_y对应，提交到后台之后由后台计算出
	
	//SuExType
	int			m_SuExType;						//票面&综收，20160302添加。参见枚举QUOTE_SU_EX_TYPE的定义
	//SuDeliveryType
	int			m_SuDeliveryType;				//上市&分销，20160302添加。参见枚举QUOTE_SU_DELIVERY_TYPE的定义
	//SuReturnType
	int			m_SuReturnType;					//无返&单返&折返，20160302添加。参见枚举QUOTE_SU_RETURN_TYPE的定义
	//ExType
	int			m_ExType;						//补充信息，0:票面;1:综收
	//Coupon
	char		m_Coupon[12];					//票面数值
	//ReturnType
	int			m_ReturnType;					//选择票面后，选择是否单返。若选择票面则此项无意义。0:无返;1:单返
	//ReturnRate
	char		m_ReturnRate[12];				//单返数值
	//ReturnRateUnit
	int			m_ReturnRateUnit;				//手续费单位，：利率；：价格

	//ComprehensiveIncome
	char		m_ComprehensiveIncome[12];		//综收数值
	//UpperLimit
	char		m_UpperLimit[12];				//上限，仅在选择综收时有效
	//Operation
	int			m_Operation;					//报价标志，0--未确认，1--已确认，2--已撤销
	//OutcomeFaceValue
	double		m_OutcomeFaceValue;				//中标票面
	//OutcomeNetPrice
	double		m_OutcomeNetPrice;				//中标净价
	//OutcomeQuantity
	double		m_OutcomeQuantity;				//中标面值
	//SingleReturnType
	int			m_SingleReturnType;				//单返方式，0为净价，1为其它
	//Commission
	double		m_Commission;					//手续费
	//BCCompanyID
	tcUnderwriterID_c m_BCCompanyID;			//机构ID
	//BCUserID
	tcUserID_c		m_BCUserID;				//联系人ID
	//BCTraderID
	tcUserID_c		m_BCTraderID;				//交易员ID
	//Time
	time_t		m_Time;							//价格最新时间，服务端时间
	//Remarks
	char		m_Remarks[64];					//备注
	//Source
	int			m_Source;						//当前记录来源，0为宏源录入，1为QB录入
	//QBUser
	xHyIDBQuoteQBUserInfo_c	m_QBUser;			//QB上的用户与机构信息
	/*******************新增交割方式， QB2.6.0， Add by Lance ********************/
	//--交割方式。针对每一条交易，而不是分配列表。首先为TP版本使用。
	//DeliveryType
	//enum DeliveryTypeEnum
	//{
	//	DT_TYPE_5 = 5,//上市单返
	//	DT_TYPE_0 = 0,//上市折返
	//	DT_TYPE_1 = 1,//上市不返
	//	DT_TYPE_2 = 2,//分销单返
	//	DT_TYPE_3 = 3,//分销折返
	//	DT_TYPE_4 = 4,//分销不返
	//};
	int			m_DeliveryType;	//交割方式。
	//Comment
	char		m_Comment[32];					//备注，10个中文字
	//QTime:债券未分配前的最新修改时间
	time_t m_QTime;
	//OTime:债券分配后的最新修改时间
	time_t m_OTime;
	/***************************************/

	//是否被修改：0-申购报价；1-修改报价；
	int m_ModifiedTag;

	//FunctionBegin
	//初始值
	xHyIDBQuoteAnnounced_c()
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_UUID);
		m_Unit = 0;
		m_UnitV2 = 0;
		_InitializeString(m_BidCouponV2_y);
		_InitializeString(m_BidCouponV2_p);
		_InitializeString(m_Vol);
		_InitializeString(m_BidCoupon);
		_InitializeString(m_BidDocPrice);
		m_SuExType = QSET_INVALID;
		m_SuDeliveryType = QSDT_INVALID;
		m_SuReturnType = QSRT_INVALID;
		m_ExType = 0;
		_InitializeString(m_Coupon);
		m_ReturnType = 0;
		_InitializeString(m_ReturnRate);
		m_ReturnRateUnit = 0;
		_InitializeString(m_ComprehensiveIncome);
		_InitializeString(m_UpperLimit);
		m_Operation = 0;
		m_OutcomeFaceValue = 0;
		m_OutcomeNetPrice = 0;
		m_OutcomeQuantity = 0;
		m_SingleReturnType = 0;
		m_Commission = 0;
		_InitializeString(m_BCCompanyID);
		_InitializeString(m_BCUserID);
		_InitializeString(m_BCTraderID);
		m_Time = 0;
		_InitializeString(m_Remarks);
		m_Source = 0;
		m_DeliveryType = 4;
		_InitializeString(m_Comment);
		m_QTime = 0;
		m_OTime = 0;
		m_ModifiedTag = 0;
	}
	//xHyIDBQuoteAnnounced_c& operator=(const xHyIDBQuoteAnnounced_c &inItem)//add by bushion.xin,20151106
	//{
	//	if(this==&inItem)
	//		return *this;
	//	_Copy_String_From_inItem(m_BondKey);
	//	_Copy_String_From_inItem(m_ListedMarket);
	//	_Copy_String_From_inItem(m_UUID);
	//	m_Unit = inItem.m_Unit;
	//	_Copy_String_From_inItem(m_Vol);
	//	_Copy_String_From_inItem(m_BidCoupon);
	//	m_SuExType = inItem.m_SuExType;
	//	m_SuDeliveryType = inItem.m_SuDeliveryType;
	//	m_SuReturnType = inItem.m_SuReturnType;
	//	m_ExType = inItem.m_ExType;
	//	_Copy_String_From_inItem(m_Coupon);
	//	m_ReturnType = inItem.m_ReturnType;
	//	_Copy_String_From_inItem(m_ReturnRate);
	//	_Copy_String_From_inItem(m_ComprehensiveIncome);
	//	_Copy_String_From_inItem(m_UpperLimit);
	//	m_Operation = inItem.m_Operation;
	//	m_OutcomeFaceValue = inItem.m_OutcomeFaceValue;
	//	m_OutcomeNetPrice = inItem.m_OutcomeNetPrice;
	//	m_OutcomeQuantity = inItem.m_OutcomeQuantity;
	//	m_SingleReturnType = inItem.m_SingleReturnType;
	//	m_Commission = inItem.m_Commission;
	//	_Copy_String_From_inItem(m_BCCompanyID);
	//	_Copy_String_From_inItem(m_BCUserID);
	//	_Copy_String_From_inItem(m_BCTraderID);
	//	m_Time = inItem.m_Time;
	//	_Copy_String_From_inItem(m_Remarks);
	//	m_Source = inItem.m_Source;
	//	m_QBUser = inItem.m_QBUser;
	//	_Copy_String_From_inItem(m_Comment);
	//	m_QTime = inItem.m_QTime;
	//	m_OTime = inItem.m_OTime;
	//	return *this;
	//}
	xHyIDBQuoteAnnounced_c& operator=(const xHyIDBBatchQuoteListItem_c &inItem)
	{
		__FIELDCOPY__(m_UUID,inItem.m_UUID);
		__FIELDCOPY__(m_Vol,inItem.m_Vol);
		__FIELDCOPY__(m_BidCoupon,inItem.m_BidCoupon);
		__FIELDCOPY__(m_BidDocPrice,inItem.m_BidDocPrice);
		
		m_SuExType = inItem.m_SuExType;
		m_SuDeliveryType = inItem.m_SuDeliveryType;
		m_SuReturnType = inItem.m_SuReturnType;
		m_ExType = inItem.m_ExType;
		m_Unit = inItem.m_Unit;
		m_UnitV2 = inItem.m_UnitV2;
		_Copy_String_From_inItem(m_BidCouponV2_y);
		_Copy_String_From_inItem(m_BidCouponV2_p);
		__FIELDCOPY__(m_Coupon,inItem.m_Coupon);
		m_ReturnType = inItem.m_ReturnType;
		__FIELDCOPY__(m_ReturnRate,inItem.m_ReturnRate);
		__FIELDCOPY__(m_ComprehensiveIncome,inItem.m_ComprehensiveIncome);
		__FIELDCOPY__(m_UpperLimit,inItem.m_UpperLimit);
		m_Operation = inItem.m_Operation;
		m_Time = inItem.m_Time;
		m_Source = inItem.m_Source;
		__FIELDCOPY__(m_Comment,inItem.m_Comment);

		return *this;
	}
	bool operator<(const xHyIDBQuoteAnnounced_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)<0;
	}
	bool operator==(const xHyIDBQuoteAnnounced_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)==0;
	}
	bool operator<(const xHyIDBBatchQuoteListItem_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)<0;
	}
	bool operator==(const xHyIDBBatchQuoteListItem_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)==0;
	}
	bool DeliveryTypeOld2New()
	{
		if(m_ExType == 0){//票面，6种
			if(m_ReturnType == 0){
				if(m_DeliveryType == 1){//票面上市不返
					m_SuExType = 1;
					m_SuDeliveryType = 1;
					m_SuReturnType = 1;
					return true;
				}
				else if(m_DeliveryType == 4){//票面分销不返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return true;
				}
				else{//无效
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return false;
				}
			}
			else if(m_ReturnType == 1){
				if(m_DeliveryType == 0){//票面上市折返
					m_SuExType = 1;
					m_SuDeliveryType = 1;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 2){//票面分销单返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 2;
					return true;
				}
				else if(m_DeliveryType == 3){//票面分销折返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 5){//票面上市单返
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 1;
					return true;
				}
				else{//无效
					m_SuExType = 1;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return false;
				}
			}
			else{//无效
				m_SuExType = 1;
				m_SuDeliveryType = 2;
				m_SuReturnType = 1;
				return false;
			}
		}
		else if(m_ExType == 1){//综收，4种
			if(m_ReturnType == 1){
				if(m_DeliveryType == 0){//综收上市折返
					m_SuExType = 2;
					m_SuDeliveryType = 1;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 2){//综收分销单返
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 2;
					return true;
				}
				else if(m_DeliveryType == 3){//综收分销折返
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return true;
				}
				else if(m_DeliveryType == 5){//综收上市单返
					m_SuExType = 2;
					m_SuDeliveryType = 1;
					m_SuReturnType = 2;
					return true;
				}
				else{//无效
					m_SuExType = 2;
					m_SuDeliveryType = 2;
					m_SuReturnType = 3;
					return false;
				}
			}
			else{//无效
				m_SuExType = 2;
				m_SuDeliveryType = 2;
				m_SuReturnType = 3;
				return false;
			}
		}
		else{//无效
			m_SuExType = 2;
			m_SuDeliveryType = 2;
			m_SuReturnType = 3;
			return false;
		}
		return false;
	};
	bool DeliveryTypeNew2Old(){
		if(m_SuExType == 1){//票面
			if(m_SuDeliveryType == 1){//上市
				if(m_SuReturnType == 1){//无返
					m_ExType = 0;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 0;
					m_DeliveryType = 5;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 0;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}
				else{//默认,票面上市不返
					m_ExType = 0;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
			}
			else if(m_SuDeliveryType == 2){//分销
				if(m_SuReturnType == 1){//无返
					m_ExType = 0;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 0;
					m_DeliveryType = 2;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 0;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}
				else{//默认,票面分销不返
					m_ExType = 0;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
			}
		}
		else if(m_SuExType == 2){//综收
			if(m_SuDeliveryType == 1){//上市
				if(m_SuReturnType == 1){//无返
					m_ExType = 1;
					m_DeliveryType = 1;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 1;
					m_DeliveryType = 5;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 1;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}				
				else{//默认，综收上市折返
					m_ExType = 1;
					m_DeliveryType = 0;
					m_ReturnType = 1;
					return true;
				}
			}
			else if(m_SuDeliveryType == 2){//分销
				if(m_SuReturnType == 1){//无返
					m_ExType = 1;
					m_DeliveryType = 4;
					m_ReturnType = 0;
					return true;
				}
				else if(m_SuReturnType == 2){//单返
					m_ExType = 1;
					m_DeliveryType = 2;
					m_ReturnType = 1;
					return true;
				}
				else if(m_SuReturnType == 3){//折返
					m_ExType = 1;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}				
				else{//默认，综收分销折返
					m_ExType = 1;
					m_DeliveryType = 3;
					m_ReturnType = 1;
					return true;
				}
			}
		}
		return false;
	};
	//FunctionEnd
};
inline bool xHyIDBBatchQuoteListItem_c::operator<(const xHyIDBQuoteAnnounced_c& that) const
{
	return strcmp(this->m_UUID,that.m_UUID)<0;
}
inline bool xHyIDBBatchQuoteListItem_c::operator==(const xHyIDBQuoteAnnounced_c& that) const
{
	return strcmp(this->m_UUID,that.m_UUID)==0;
}

//inner
//
//宏源报价记录类（未公告，报价与修改、详情、意向窗口及自动更新使用）。
//xHyIDBQuoteUnannounced
class xHyIDBQuoteUnannounced_c
{
public:
	//BondKey
	tcBondKey_c		m_BondKey;					//bondkey
	//ListedMarket
	tcListedMarket_c m_ListedMarket;			//市场
	//UUID
	tcUUID_c	m_UUID;							//记录的UUID，报价提交(55001)时不用，详情查询(55003)和更新(55032)时使用
	//Yield
	char		m_Yield[12];					//价格收益率
	//Vol
	char		m_Vol[12];					    //面值
	//BCCompanyID
	tcUnderwriterID_c	m_BCCompanyID;			//机构ID
	//BCUserID
	tcUserID_c		m_BCUserID;					//联系人ID
	//BCTraderID
	tcUserID_c		m_BCTraderID;				//交易员ID
	//Time
	time_t		m_Time;							//价格最新时间，服务端时间
	//Source
	int			m_Source;						//当前记录来源，0为宏源录入，1为QB录入
	//QBUser
	xHyIDBQuoteQBUserInfo_c	m_QBUser;			//QB上的用户与机构信息
	//FunctionBegin
	//初始值
	xHyIDBQuoteUnannounced_c()
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_UUID);
		_InitializeString(m_Yield);
		_InitializeString(m_Vol);
		_InitializeString(m_BCCompanyID);
		_InitializeString(m_BCUserID);
		_InitializeString(m_BCTraderID);
		m_Time = 0;
		m_Source = 0;
	}
	//重载运算符用于比较
	bool operator<(const xHyIDBQuoteUnannounced_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)<0;
	}
	bool operator==(const xHyIDBQuoteUnannounced_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)==0;
	}
	//FunctionEnd
};

//inner
//
//承/分销商与对应的中标量（分配窗口使用）。
//xHyIDBUnderwriterBidQuantity
class xHyIDBUnderwriterBidQuantity_c
{
public:
	//UnderwriterCode
	char m_UnderwriterCode[7+1];		//承/分销商ID
	//UnderwriterName
	char m_UnderwriterName[128];		//承/分销商名称
	//BidQuantity
	double m_BidQuantity;				//中标量
	//DistributionPrice
	double m_DistributionPrice;			//分销价格
	//FeeRate
	double m_FeeRate;					//手续费率
	//FunctionBegin
	//初始值
	xHyIDBUnderwriterBidQuantity_c()
	{
		memset(this,0,sizeof(xHyIDBUnderwriterBidQuantity_c));
	}
	//FunctionEnd
};

//inner
//
//宏源报价记录类（分配窗口使用）。
//xHyIDBQuoteDistribute
class xHyIDBQuoteDistribute_c : public xHyIDBQuoteAnnounced_c
{
public:
	bool operator<(const xHyIDBQuoteDistribute_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)<0;
	}
	bool operator==(const xHyIDBQuoteDistribute_c& that) const
	{
		return strcmp(this->m_UUID,that.m_UUID)==0;
	}
	//FunctionEnd
};

//InvalidAreaBegin
//用户权限表（查询用户权限用）。
enum TraderAuthority
{
	MT_OAF_INPUTINTENTION		= 1,				//输入意向		--未公告债券报价
	MT_OAF_INPUTQUOTATION		= 2,				//输入报价		--已公告债券报价
	MT_OAF_EDITFORECAST			= 3,				//编辑预测		--未公告编辑行情
	MT_OAF_EDITQUOTATION		= 4,				//编辑报价		--已公告编辑行情
	MT_OAF_BID					= 5,				//投标
	MT_OAF_CANCELBID			= 6,				//撤销投标
	MT_OAF_ALLOCATE				= 7,				//分配
	MT_OAF_CANCELALLOCATE		= 8,				//撤销分配
	MT_OAF_SUBMITAPPROVAL		= 9,				//提交审批
	MT_OAF_GENERATEPROTOCOL		= 10,				//生成协议
	MT_OAF_ALLOWUPGRADE			= 11,				//允许升级
	MT_OAF_BIDAPPROVAL			= 12,				//申购审批
	MT_OAF_ALLOCATEAPPROVAL		= 13,				//分配审批
	MT_OAF_HELPDESK				= 14,				//前台联系方式
	MT_OAF_BIDTAG				= 15,				//申购标签
	MT_OAF_QUOTATIONSRC			= 16,				//报价来源
	MT_OAF_PUSH					= 17,				//推送
	MT_OAF_CREDITLIMIT			= 18				//授信额度设置
};
//InvalidAreaEnd

//inner
//
//权限类，单项表示一种权限（查询用户权限用）。
//xHyIDBAuthorityItem
class xHyIDBAuthorityItem_c
{
public:
	//FID
	int m_FID;
};

//inner
//
//前台联系方式结构体
typedef struct _xHyTraderInfo_{
	char id[32+1];
	char name_en[32+1];
	char name_cn[32+1];
	char email[32+1];
	char mobile[32+1];
	char tel[32+1];
	char qm[32+1];
	uint32_t departid;			//部门ID
	char department[32+1];	//部门名称
	uint32_t teamid;			//团队ID
	char team[32+1];		//团队名称 2016.1.4 add by lance
	_xHyTraderInfo_(){
		memset(this, 0, sizeof(_xHyTraderInfo_));
	}
}XHyTraderInfo, *PXHyTraderInfo;

//xHyIDBContactInfo
class xHyIDBContactInfo_c
{
public:
	//ContactMsg
	char m_ContactMsg[256];						//联系信息
	//QRCodeMsg
	char m_QRCodeMsg[256];						//生成二维码的信息
	//UserIDList
	std::list<std::string> m_UserIDList;		//宏源方被选中的联系人ID列表
	//UserInfoList
	std::list<XHyTraderInfo> m_UserInfoList;		//宏源方被选中的联系人具体信息列表
	xHyIDBContactInfo_c()
	{
		_InitializeString(m_ContactMsg);
		_InitializeString(m_QRCodeMsg);
	}
};

//inner
//
//推送筛选所需的机构列表信息，用于客户端启动时拉取全量55050及筛选窗口列表展示
//xHyIDBClientInstitutionInfo
class xHyIDBClientInstitutionInfo_c
{
public:
	//ID
	char m_ID[32+1];
	//FullNameCN
	char m_FullNameCN[256];
	//FullNameEN
	char m_FullNameEN[256];
	//ShortNameCN
	char m_ShortNameCN[256];
	//ShortNameEN
	char m_ShortNameEN[256];
	//FunctionBegin
	char m_SSPinyin[64+1];					//简称简拼
	char m_SFPinyin[256+1];					//简称全拼
	char m_FSPinyin[64+1];					//全称简拼
	char m_FFPinyin[256+1];					//全称全拼
	//初始值
	xHyIDBClientInstitutionInfo_c()
	{
		_InitializeString(m_ID);
		_InitializeString(m_FullNameCN);
		_InitializeString(m_FullNameEN);
		_InitializeString(m_ShortNameCN);
		_InitializeString(m_ShortNameEN);
		_InitializeString(m_SSPinyin);
		_InitializeString(m_SFPinyin);
		_InitializeString(m_FSPinyin);
		_InitializeString(m_FFPinyin);
	}
	xHyIDBClientInstitutionInfo_c& operator=(const xHyIDBClientInstitutionInfo_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;
		__FIELDCOPY__(m_ID, inItem.m_ID);
		__FIELDCOPY__(m_FullNameCN, inItem.m_FullNameCN);
		__FIELDCOPY__(m_FullNameEN, inItem.m_FullNameEN);
		__FIELDCOPY__(m_ShortNameCN, inItem.m_ShortNameCN);
		__FIELDCOPY__(m_ShortNameEN, inItem.m_ShortNameEN);
		__FIELDCOPY__(m_SSPinyin, inItem.m_SSPinyin);
		__FIELDCOPY__(m_SFPinyin, inItem.m_SFPinyin);
		__FIELDCOPY__(m_FSPinyin, inItem.m_FSPinyin);
		__FIELDCOPY__(m_FFPinyin, inItem.m_FFPinyin);
		return *this;
	}
	//FunctionEnd
};

//inner
//
//单支债券的推送筛选信息，用于获取全量债券推送设定列表55051、发送变更消息55052和接收实时更新55053
//xHyIDBPushInfo
class xHyIDBPushInfo_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//PushMode
	int m_PushMode;					//推送方式，0：全量；1：白名单；2：黑名单（排除模式）
	//PushList
	//char m_PushList[4096];
	std::string m_PushList;			//推送机构列表，以“|”分隔。具体内容是黑名单还是白名单要看m_PushMode的设定。
	//FunctionBegin
	//初始值
	xHyIDBPushInfo_c()
	{
		m_PushMode = 0;
		m_PushList = "";
	}
	xHyIDBPushInfo_c& operator=(const xHyIDBPushInfo_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;
		m_PK = inItem.m_PK;
		m_PushMode = inItem.m_PushMode;
		m_PushList = inItem.m_PushList;
		return *this;
	}
	//FunctionEnd
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTE_ANNOUNCED           	    = 55000,            // 报价、修改（已公告）			--报价、修改共用此消息号

//request
//E_FID_HY_BOND_QUOTE_ANNOUNCED
//55000,宏源报价（已公告）。
//xHyIDBQuoteAnnouncedReq
class xHyIDBQuoteAnnouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//Quote
	xHyIDBQuoteAnnounced_c m_Quote;		//报价信息
};

//--55000返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTE_UNANNOUNCED         	    = 55001,            // 报价、修改（未公告）					--报价与修改共用此消息号

//request
//E_FID_HY_BOND_QUOTE_UNANNOUNCED
//55001,宏源报价、修改（未公告,意向报价）
//xHyIDBQuoteUnannouncedReq
class xHyIDBQuoteUnannouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//Quote
	xHyIDBQuoteUnannounced_c m_Quote;			//报价信息
};

//--55001返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTEINFO_ANNOUNCED       	    = 55002,            // 债券详情（已公告）					--查询债券报价详情

//request
//E_FID_HY_BOND_QUOTEINFO_ANNOUNCED
//55002,宏源报价详情(已公告)
//xHyIDBQuoteInfoAnnouncedReq
class xHyIDBQuoteInfoAnnouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
};

//response
//E_FID_HY_BOND_QUOTEINFO_ANNOUNCED
//55002,宏源报价详情(已公告)(response)
//xHyIDBQuoteInfoAnnouncedAck
class xHyIDBQuoteInfoAnnouncedAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteAnnounced_c> m_QList;	//详情
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTEINFO_UNANNOUNCED     	    = 55003,            // 债券详情（未公告）					--查询债券报价详情

//request
//E_FID_HY_BOND_QUOTEINFO_UNANNOUNCED
//55003,宏源报价详情(未公告)
//xHyIDBQuoteInfoUnannouncedReq
class xHyIDBQuoteInfoUnannouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
};

//response
//E_FID_HY_BOND_QUOTEINFO_UNANNOUNCED
//55003,宏源报价详情(未公告)
//xHyIDBQuoteInfoUnannouncedAck
class xHyIDBQuoteInfoUnannouncedAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteUnannounced_c> m_QList;	//详情
};

//-------------------------------------------------------------------------------------
typedef enum Bond_Quote_Status_e
{
	//--状态说明：(宁波银行的需求中：信用债没有“已投标”状态，信用债和利率债均无“已分配”状态，以“等待分配审批”代替。分配流程所有债券均需要审批。)
	e_NOTender                             = 0, //--0:未投标、撤销投标
	e_Tender                                 = 1,//--1:等待分配（申购审批通过也变为此状态）、已截标、撤销分配
	e_Assign                                  = 2,//--2:已分配、等待交易、撤销交易
	e_CancelAssign                         = 3,//--3:撤销分配  (以后会废弃)
	e_CancelTender                        = 4,//--4:撤销投标
	e_AWaitTenderApproval             = 5,//--5:等待投标审批
	e_TenderApproval                     = 6,//--6:投标审批中
	e_WithoutApprovalByTender       = 7,//--7:投标审批未通过
	e_AWaitDistributionApproval       = 8,//--8:等待分配审批
	e_DistributionApproval               = 9,//--9:分配审批中
	e_WithoutApprovalByDistribution = 10,//--10:分配审批未通过
	e_ApprovalDistribution               = 11,//--11:分配审批通过
	e_Traded                                 = 12//--12:已交易
	//--实际的状态变更流程（排序时的顺序）如下：
	//--0:未投标 < 4:撤销投标 < 5:等待投标审批 < 6:投标审批中 < 7:投标审批未通过 < 1:等待分配 < 8:等待分配审批 < 9:分配审批中< 3:撤销分配 < 10:分配审批未通过 < 11:分配审批通过 < 2:已分配

}E_BOND_QUOTE_STATUS;

//--E_FID_HY_BOND_COMPILE_ANNOUNCED         	    = 55004,            // 编辑（已公告）						--投标区间，截标时间，推荐状态
//--E_FID_HY_BOND_COMPILE_UNANNOUNCED       	    = 55005,            // 编辑（未公告）						--预测价格区间，预测发行时间

//request
//E_FID_HY_BOND_COMPILE_ANNOUNCED,E_FID_HY_BOND_COMPILE_UNANNOUNCED
//债券行情信息类,55004,55005
//xHyBondQuotationInfoReq
class xHyBondQuotationInfoReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//bk
	tcBondKey_c m_BondKey;				//债券key
	//lm
	tcListedMarket_c m_ListedMarket;	//发行市场
	//bs
	char m_BondScore[20];			//债券评分（平安版本需求）
	//rd	
	int m_Recommended;				//是否被推荐。0：不推荐；1：推荐（后续如果需要排序可以使用此标志位）
	//ps
	int m_Pushed;					//推送状态 0，1
	//ops;
	int m_OncePushed;				//曾经推送标识，0-从未推送；1-曾经推送过；
	//st
	int	m_Status;					//状态（是否投标等）
	//--E_BOND_QUOTE_STATUS 状态说明：(宁波银行的需求中：信用债没有“已投标”状态，信用债和利率债均无“已分配”状态，以“等待分配审批”代替。分配流程所有债券均需要审批。)
	//--0:未投标、撤销投标
	//--1:等待分配（申购审批通过也变为此状态）、已截标、撤销分配
	//--2:已分配、等待交易、撤销交易
	//--3:撤销分配
	//--4:撤销投标
	//--5:等待投标审批
	//--6:投标审批中
	//--7:投标审批未通过
	//--8:等待分配审批
	//--9:分配审批中
	//--10:分配审批未通过
	//--11:分配审批通过
	//--12:已交易
	//--实际的状态变更流程（排序时的顺序）如下：
	//--0:未投标 < 4:撤销投标 < 5:等待投标审批 < 6:投标审批中 < 7:投标审批未通过 < 1:等待分配 < 8:等待分配审批 < 9:分配审批中< 3:撤销分配 < 10:分配审批未通过 < 11:分配审批通过 < 2:已分配

	//dp
	int m_DelayPublication;			//是否推迟发行 0:不推迟 1:已推迟
	//hb
	int m_HaveBid;					//是否有报价，包括未确认、已确认和已撤销 0:没有 1:有
	//cb
	char m_ConfirmedBid[5];			//当前债券是否有已确认的报价。"CBID"为有，"NBID"为没有。
	//mtp
	int m_MarketType;				//市场状态，与字典BondList中重复。判断逻辑:若字典中为2，则判定为2；否则，以行情中的值优先；行情中无此值，取字典中的值
	//ut
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//ha
	int m_HasAuction;				//标位设置是否生效--0：未生效，1：已生效
	//alu
	int m_AuctionLimitUnit;			//单一标位上限单位		--	0:百分比(%),1:面值(元)
	//al
	char m_AuctionLimit[10+1];		//单一标位上限_
	//bll
	char m_BidLowerLimit[8+1];		//投标区间下限
	//bul
	char m_BidUpperLimit[8+1];		//投标区间上限
	//sll
	char m_SuggestLowerLimit[8+1];	//建议投标区间下限
	//sul
	char m_SuggestUpperLimit[8+1];	//建议投标区间上限
	//bet
	time_t m_BidEndTime;			//截标时间
	//pll
	char m_PreLowerLimit[8+1];		//预测价格下限
	//pul
	char m_PreUpperLimit[8+1];		//预测价格上限
	//pt
	time_t m_PreTime;				//预测发行时间
	//bp
	double m_BidPrice;				//中标价格（分配时填写）/票面利率（宏源端填写票面利率窗口填写）
	//crb
	double m_CreditBalance;			//授信余额，行情实时更新消息用，编辑时不发送此字段
	//mt
	time_t m_ModifyTime;			//本条记录最新修改时间
	//ds
	char m_Description[1000+1];		//产品描述
	//am
	char m_ApprovalMsg[60+1];		//审批信息
	//un
	char m_UnderwriterName[128];	//分销团
	//mf
	int m_ModifyFlag;				//变更标志:0表示无变更;1表示区间变更
	//spd
	char m_Spread[8+1];				//基准利率值

	//rru
	int m_ReturnRateUnit;               //手续费单位，0：利率；1：价格
	//rr
	char m_ReturnRate[12];              //单返数值，手续费

	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//以下是一级分销系统需要的字段
	////cbc
	//int m_CreditBalanceControlled;    //是否需要进行授信余额控制。0：不需要；1：需要。默认为0。
	////uc
	//int m_UnitConfirmed;                       //单位是否已经被锁定。
	////qie
	//int m_QuotationInfoEdited;            //此行情是否被用户编辑过。
	////balu
	//int m_BidAmountLimitUnit;            //投标总量上限单位               --       0:百分比(%),1:面值(元)
	////bal
	//char m_BidAmountLimit[16+1];     //投标总量上限
	////sh
	//int m_SendToHengtai;                      //宏源专用，是否推送至衡泰，0：未推送/已撤回，1：已推送
	////sp
	//char m_Supervisor[32+1];                //负责人，目前暂定使用ID，由当前交易员中选择

	//FunctionBegin

	//初始值
	xHyBondQuotationInfoReq_c()
	{
		memset(this, 0, sizeof(xHyBondQuotationInfoReq_c));
		m_Pushed = 0;
		m_OncePushed = 0;
		m_Status = 0;
		m_BidEndTime = 0;
		m_PreTime = 0;
		m_BidPrice = 0.0f;
		m_MarketType = VALID_MARKET_TYPE;
		m_CreditBalance = VALID_CREDIT_BALANCE;
		m_BidPrice = 0.0;
		m_Unit = 0;
		m_AuctionLimitUnit = 0;
		_InitializeString(m_AuctionLimit);
		m_Recommended = 0;
		m_ModifyFlag = 0;
		m_ReturnRateUnit = 0;
		_InitializeString(m_ReturnRate);
	}
	//FunctionEnd
};

//--55004,55005返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_COMPILEINFO_ANNOUNCED     	    = 55006,            // 推送，行情实时更新					--编辑详情推送 
//--E_FID_HY_BOND_QUOTATION                 	    = 55020,            // 行情全量更新							--首次登录或者断线重连后从服务器把所有的行情数据拉取一次

//request
//E_FID_HY_BOND_QUOTATION
//接收债券行情列表全量更新(55020)。发送空结构体。
//xHyBondQuotationListAck
class xHyBondQuotationListReq_c : public xHyIDBMsgBaseClass_c
{
};

//response
//E_FID_HY_BOND_COMPILEINFO_ANNOUNCED,E_FID_HY_BOND_QUOTATION
//接收债券行情列表，自动更新(55006)与全量更新(55020)。自动更新无请求值，全量更新发送空结构体
//xHyBondQuotationListAck
class xHyBondQuotationListAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyBondQuotationInfoReq_c> m_List;	//债券行情列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_BID_LIST_HISTORY			   	    = 55007,            // 债券详情页							--查询历史标位

//inner
//
//宏源报价记录类（历史标位中使用）。
//xHyIDBQuoteHistory
class xHyIDBQuoteHistory_c
{
public:
	//Time
	time_t		m_Time;							//投标时间
	//UUID
	tcUUID_c	m_UUID;							//记录的UUID，报价提交(55000)时不用，详情查询(55002)和更新(55031)时使用
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//Vol
	char		m_Vol[12];					    //面值
	//BidCoupon
	char		m_BidCoupon[12];				//投标票面，由前台计算得出，投标提交时后台入库；之后查询时不再计算，由后台提供
	//ExType
	int			m_ExType;						//补充信息，0:票面;1:综收
	//Coupon
	char		m_Coupon[12];					//票面数值
	//ReturnType
	int			m_ReturnType;					//选择票面后，选择是否单返。若选择票面则此项无意义。0:无返;1:单返
	//ReturnRate
	char		m_ReturnRate[12];				//单返数值
	//ComprehensiveIncome
	char		m_ComprehensiveIncome[12];		//综收数值
	//UpperLimit
	char		m_UpperLimit[12];				//上限，仅在选择综收时有效
	//Remarks
	char		m_Remarks[64];					//备注
	//FunctionBegin
	//初始值
	xHyIDBQuoteHistory_c()
	{
		m_Time = 0;
		_InitializeString(m_UUID);
		m_Unit = 0;
		_InitializeString(m_Vol);
		_InitializeString(m_BidCoupon);
		m_ExType = 0;
		_InitializeString(m_Coupon);
		m_ReturnType = 0;
		_InitializeString(m_ReturnRate);
		_InitializeString(m_ComprehensiveIncome);
		_InitializeString(m_UpperLimit);
		_InitializeString(m_Remarks);
	}
	//FunctionEnd
};

//inner
//
//历史标位中的一组记录
//xHyIDBBidListItem
class xHyIDBBidListItem_c
{
public:
	//BidList
	std::vector<xHyIDBQuoteHistory_c> m_BidList;	//报价列表
	//FunctionBegin
	bool operator<(const xHyIDBBidListItem_c& that) const
	{
		if(this->m_BidList.empty() || that.m_BidList.empty())
			return false;
		return this->m_BidList[0].m_Time<that.m_BidList[0].m_Time;
	}
	//FunctionEnd
};

//request
//E_FID_HY_BOND_BID_LIST_HISTORY
//55007 债券详情页--查询历史标位
//xHyIDBBidListHistoryReq
class xHyIDBBidListHistoryReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//Size
	int m_Size;						//取历史标位的最大记录数。目前宁波银行需求（20150122）为10条。
	//FunctionBegin
	//初始值
	xHyIDBBidListHistoryReq_c()
	{
		m_Size = 10;				//设定初始值
	}
	//FunctionEnd
};

//response
//E_FID_HY_BOND_BID_LIST_HISTORY
//55007 债券详情页--查询历史标位
//xHyIDBBidListHistoryAck
class xHyIDBBidListHistoryAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//BidItemList
	std::vector<xHyIDBBidListItem_c> m_BidItemList;	//历史标位列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH                      	    = 55008,            // 推送状态变更							--推送与取消推送（债券是否推到QB端的“推送”状态，不是后台向前台的推送消息）

//request
//E_FID_HY_BOND_PUSH
//55008,推送与取消推送
//xHyBondPushReq
class xHyBondPushReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyIDBBondPK_c> m_List;	//推送或者取消推送的债券列表
	//IsPushed
	int m_IsPushed;		//0为取消推送，1为推送
	xHyBondPushReq_c()
	{
		m_IsPushed = 0;
	}
};

//--55008返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUERY_ALL_TRADERS            	    = 55009,            // 报价（QB使用）						--查询当前券商的所有交易员，用于在报价时进行选择。QB端报价使用，承分销端不需要
//--E_FID_NCD_BOND_QUERY_ALL_TRADERS				= 55069,            // 报价（QB使用）	-----NCD应用-----	--查询当前券商的所有交易员，用于在报价时进行选择。QB端报价使用，承分销端不需要
//QM在线状态
enum QM_PRESENCE_SHOW
{
	SHOW_UNDEFINE = 0,	//无法获取状态
	SHOW_OFFLINE = 1,	// 离线 
	SHOW_ONLINE = 2,	// 在线 
	SHOW_AWAY = 3,		// 离开 
	SHOW_BUSY = 4,		// 忙碌 
	SHOW_INVISIBLE = 5,	// 隐身 
	SHOW_MAX,
};
enum QM_CURRENT_SHOW
{
	SHOW_CURRENT_OFFLINE = -1,	//不在线
	SHOW_CURRENT_ONLINE = 1,	// 在线
	SHOW_CURRENT_LOGGING = 2,	// 正在登录中  
	SHOW_CURRENT_MAX,
};
//inner
//
//
//xHyTraderSimpleInfo
class xHyTraderSimpleInfo_c
{
public:
	//ID
	char m_ID[20];
	//Name_en
	char m_Name_en[64];
	//Name_cn
	char m_Name_cn[64];
	//Name_cn_yp_short
	char m_Name_cn_yp_short[256];
	//Name_cn_yp_full
	char m_Name_cn_yp_full[256];
	//UserAccount
	char m_UserAccount[64];		//QB用户名（QM登录名）
	//Mobile
	char m_Mobile[32+1];//移动电话
	//Tel
	char m_Tel[32+1];//固话
	//Role
	char m_Role[12];//角色
	//QM_ID
	int64_t m_QM_ID;			//QMID
	//QM_Status
	int m_QM_Status;			//QM在线状态。
	//FunctionBegin
	//初始值
	xHyTraderSimpleInfo_c()
	{
		_InitializeString(m_ID);
		_InitializeString(m_Name_en);
		_InitializeString(m_Name_cn);
		_InitializeString(m_Name_cn_yp_short);
		_InitializeString(m_Name_cn_yp_full);
		_InitializeString(m_UserAccount);
		_InitializeString(m_Mobile);
		_InitializeString(m_Tel);
		_InitializeString(m_Role);
		m_QM_ID = 0;
		m_QM_Status = SHOW_UNDEFINE;
	}
	xHyTraderSimpleInfo_c& operator=(const xHyTraderSimpleInfo_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;

		_Copy_String_From_inItem(m_ID);
		_Copy_String_From_inItem(m_Name_en);
		_Copy_String_From_inItem(m_Name_cn);
		_Copy_String_From_inItem(m_Name_cn_yp_short);
		_Copy_String_From_inItem(m_Name_cn_yp_full);
		_Copy_String_From_inItem(m_UserAccount);
		_Copy_String_From_inItem(m_Mobile);
		_Copy_String_From_inItem(m_Tel);
		_Copy_String_From_inItem(m_Role);
		m_QM_ID = inItem.m_QM_ID;
		m_QM_Status = inItem.m_QM_Status;
		return *this;
	}
	//FunctionEnd
};
//request
//E_FID_HY_BOND_QUERY_ALL_TRADERS,E_FID_NCD_BOND_QUERY_ALL_TRADERS
//55009,报价（QB使用）--查询当前券商的所有交易员，用于在报价时进行选择。QB端报价使用，承分销端不需要
//xHyIDBBondQueryAllTradersReq
typedef xHyIDBMsgBaseClass_c xHyIDBBondQueryAllTradersReq_c;

//response
//E_FID_HY_BOND_QUERY_ALL_TRADERS,E_FID_NCD_BOND_QUERY_ALL_TRADERS
//55009,报价（QB使用）--查询当前券商的所有交易员，用于在报价时进行选择。QB端报价使用，承分销端不需要
//xHyIDBBondQueryAllTradersAck
class xHyIDBBondQueryAllTradersAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyTraderSimpleInfo_c> m_List;		//所有当前券商的交易员列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_STATUS_CHANGE             	    = 55010,            // 投标、撤销投标、撤销分配等			--债券状态变化，包括：投标，撤销投标，撤销分配，投标审批，撤销投标审批，分配审批，撤销分配审批。（分配动作中会随其它数据一起发送，不必单独发送此消息）。具体可参见55004行情类xHyBondQuotationInfoReq_c中的定义。

//request
//E_FID_HY_BOND_STATUS_CHANGE
//55010.债券状态变化
//xHyBondStatusChangeReq
class xHyBondStatusChangeReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//BondKey
	tcBondKey_c		m_BondKey;				//bondkey
	//ListedMarket
	tcListedMarket_c m_ListedMarket;				//市场
	//Status
	int			m_Status;						//债券状态变化
	xHyBondStatusChangeReq_c()
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		m_Status = 0;
	}
};

//--55010返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTE_CONFIRM                	    = 55011,            // 债券详情、申购						--报价状态变化，确认（目前需求中只有这一种情况）

//request
//E_FID_HY_BOND_QUOTE_CONFIRM
//55011,报价记录状态变更（目前只做确认动作）
//xHyBondQuoteConfirmReq
class xHyBondQuoteConfirmReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//Quote
	xHyIDBQuoteAnnounced_c m_Quote;		//报价信息
};

//--55011返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DISTRIBUTE_REQUEST        	    = 55012,            // 分配									--请求主承销商与分销商信息及中标价格和倍数（发送主键，获取列表与默认值）

//request
//E_FID_HY_BOND_DISTRIBUTE_REQUEST
//55012,请求分配窗体的上半部分信息（主承销商与分销商信息及中标价格和倍数）
//xHyIDBDistributeRequestReq
class xHyIDBDistributeRequestReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
};

//response
//E_FID_HY_BOND_DISTRIBUTE_REQUEST
//55012.分配窗体的上半部分信息（主承销商与分销商信息及中标价格和倍数）。
//xHyIDBDistributeRequestAck
class xHyIDBDistributeRequestAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//BidQuantity
	double m_BidQuantity;				//无主承销商时的中标量
	//DistributionPrice
	double m_DistributionPrice;			//无主承销商时的分销价格
	//FeeRate
	double m_FeeRate;					//无主承销商时的手续费率
	//MainUnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_MainUnderwriterList;	//主承销商
	//UnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_UnderwriterList;		//分销团
	//TenderingType
	int m_TenderingType;				//招标方式		--0：荷兰式，1：美国式，2：混合式
	//WeightedAveragePrice
	double m_WeightedAveragePrice;		//全场加权平均中标价
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//BidPrice
	double m_BidPrice;					//中标价位
	//BidMultiple
	double m_BidMultiple;	//边际倍数
	//DeliveryType
	int m_DeliveryType;		//交割方式
	xHyIDBDistributeRequestAck_c()
	{
		m_BidQuantity = 0.0f;
		m_DistributionPrice = 0.0f;
		m_FeeRate = 0.0f;
		m_BidPrice = 0;
		m_BidMultiple = 0;
		m_TenderingType = 0;
		m_WeightedAveragePrice = 0.0f;
		m_Unit = 0;
		m_DeliveryType = 0;
	}
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_UNUSED_2			         	    = 55013,            // 未使用消息号
//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DISTRIBUTE_LIST_REQUEST   	    = 55014,            // 分配									--请求分配列表（发送主键，获取列表与默认值）

//request
//E_FID_HY_BOND_DISTRIBUTE_LIST_REQUEST
//55014,请求分配窗体的下半部分信息（分配列表）
//xHyIDBDistributeListRequestReq
class xHyIDBDistributeListRequestReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
};

//response
//E_FID_HY_BOND_DISTRIBUTE_LIST_REQUEST
//55014,请求分配窗体的下半部分信息（分配列表）
//xHyIDBDistributeListRequestAck
class xHyIDBDistributeListRequestAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteDistribute_c> m_QList;	//报价列表
};

//-------------------------------------------------------------------------------------
//	E_FID_HY_BOND_BID_REQ						= 55202,			// 宏源、我的中标记录
//request
class xHyIDBBondBidReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	tcUserID_c m_UserID;			//用户id
	tcUnderwriterID_c m_CompanyID;			//公司id
	xHyIDBBondBidReq_c()
	{
		_InitializeString(m_UserID);
		_InitializeString(m_CompanyID);
	}
};
//应答同55014

//-------------------------------------------------------------------------------------
//--未完成
//--E_FID_HY_BOND_AUDIT                     	    = 55015,            // 审批 
//--E_FID_HY_BOND_PAY                       	    = 55016,            // 缴款信息 
//--E_FID_HY_BOND_TOHISTORY                 	    = 55017,            // 生成协议表示完成
//--E_FID_HY_BOND_MENUINFO                  	    = 55018,            // 菜单弹出对话框的债券信息
//--E_FID_HY_BOND_HISTORYINFO               	    = 55019,            // 历史详情债券信息 xingguo

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTATION                 	    = 55020,            // 行情全量更新							--首次登录或者断线重连后从服务器把所有的行情数据拉取一次

//--见55006

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_NOTICE_PUBLISH					= 55021,			// 发布公告
//--E_FID_HY_BOND_NOTICE_MODIFY						= 55022,			// 修改公告

//request
//E_FID_HY_BOND_NOTICE_PUBLISH,E_FID_HY_BOND_NOTICE_MODIFY
//55021，55022，公告记录的信息，发布与修改
//xHyBondNoticePublishReq
class xHyBondNoticePublishReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UUID
	tcUUID_c	m_UUID;								//序列号,修改和删除的时候使用，新公告时为空
	//Title
	char		m_Title[60+1];						//名称
	//Notice
	char		m_Notice[300+1];					//内容
	//Time
	time_t		m_Time;								//发布时间

	//Type
	int			m_Type;								//0-原有一级公告；1-新闻；2-pdf文件；
	char		m_Url[511];							//公告 & pdf文档 url

	//FunctionBegin
	//初始值
	xHyBondNoticePublishReq_c()
	{
		_InitializeString(m_UUID);
		_InitializeString(m_Title);
		_InitializeString(m_Notice);
		m_Time = 0;

		m_Type = 0;
		_InitializeString(m_Url);
	}
	xHyBondNoticePublishReq_c& operator=(const xHyBondNoticePublishReq_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;

		__FIELDCOPY__(m_UUID, inItem.m_UUID);
		__FIELDCOPY__(m_Title, inItem.m_Title);
		__FIELDCOPY__(m_Notice, inItem.m_Notice);
		m_Time = inItem.m_Time;

		m_Type = inItem.m_Type;
		__FIELDCOPY__(m_Url, inItem.m_Url);

		return *this;
	}
	//FunctionEnd
};

//--55021,55022返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_NOTICE_DEL						= 55023,			// 删除公告

//request
//E_FID_HY_BOND_NOTICE_DEL
//55023，公告记录的删除
//xHyBondDeleteNoticeReq
class xHyBondDeleteNoticeReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UUID
	tcUUID_c	m_UUID;						//序列号
	//FunctionBegin
	//初始值
	xHyBondDeleteNoticeReq_c()
	{
		_InitializeString(m_UUID);
	}
	//FunctionEnd
};

//--55023返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_NOTICE_QUERY						= 55024,			// 查询公告

//request
//E_FID_HY_BOND_NOTICE_QUERY
//55024，公告记录的全量查询，空类，只有基类中的UnderwriterID
//xHyBondQueryNoticeReq
class xHyBondQueryNoticeReq_c : public xHyIDBMsgBaseClass_c
{
};

//response
//E_FID_HY_BOND_NOTICE_QUERY
//55024，公告记录的全量查询
//xHyBondQueryNoticeAck
class xHyBondQueryNoticeAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyBondNoticePublishReq_c> m_List;	//公告列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_NOTICE_PUBLISH_PUSH				= 55025,			// 推送，公告							--发布公告
//--E_FID_HY_BOND_NOTICE_MODIFY_PUSH				= 55026,			// 推送，公告							--修改公告

//response
//E_FID_HY_BOND_NOTICE_PUBLISH_PUSH,E_FID_HY_BOND_NOTICE_MODIFY_PUSH
//55025，55026，公告记录的信息，发布与修改
//xHyBondNoticePublishAutoAck
class xHyBondNoticePublishAutoAck_c : public xHyBondNoticePublishReq_c
{
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_NOTICE_DEL_PUSH					= 55027,			// 推送，公告							--删除公告

//response
//E_FID_HY_BOND_NOTICE_DEL_PUSH
//55027，公告记录的删除
//xHyBondDeleteNoticeAutoAck
class xHyBondDeleteNoticeAutoAck_c : public xHyBondDeleteNoticeReq_c
{
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTE_COMM_PUSH					= 55028,			// 推送，公告							--批量注册推送
//--E_FID_HY_BOND_QUOTE_COMM_PUSH_CANCEL			= 55029,			// 推送，公告							--批量注销推送

//-------------------------------------------------------------------------------------
//--未启用功能
//--E_FID_HY_BOND_RECOMMENDED						= 55030,			// 推荐状态查询							--查询推荐债券（两支，目前未启用）

//response
//E_FID_HY_BOND_RECOMMENDED
//55030,查询推荐债券
//xHyBondRecommendedAck
class xHyBondRecommendedAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyIDBBondPK_c> m_List;			//推荐债券列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTEINFO_ANNOUNCED_UPDATE		= 55031,            // 推送，报价详情自动更新（已公告）		--内存中不存储此数据，供注册此消息号的窗体使用

enum EClearFlag
{
	EClearFlag_Distribute = 0,                                                               // 清除分配信息
	EClearFlag_Trade_Commission,                                                    // 交易明细，手续费表
	EClearFlag_Trade_Detail,                                                                // 交易明细
	EClearFlag_Payment,                                                                                 // 缴款分销
	EClearFlag_Listed_Trade,                                                                // 上市交易
};

// 清除标志列表
// ClearTradeFlags
class ClearTradeFlags
{
public:
	// ClearTradeFlags
	std::vector<EClearFlag> lsClearFlags;
};
//response
//E_FID_HY_BOND_QUOTEINFO_ANNOUNCED_UPDATE
//55031,宏源已公告编辑详情自动更新
//xHyIDBQuoteInfoAnnouncedUpdate
class xHyIDBQuoteInfoAnnouncedUpdateAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteAnnounced_c> m_QList;	//详情
	//DeleteList
	std::list<std::string> m_DeleteList;		//需要删除的记录列表（UUID），用于实时更新
	// ClearTradeFlags
	ClearTradeFlags m_ClearFlags; //清除标志列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_QUOTEINFO_UNANNOUNCED_UPDATE		= 55032,            // 推送，报价详情自动更新（未公告）		--内存中不存储此数据，供注册此消息号的窗体使用

//response
//E_FID_HY_BOND_QUOTEINFO_UNANNOUNCED_UPDATE
//55032,宏源未公告编辑详情自动更新
//xHyIDBQuoteInfoUnannouncedUpdateAck
class xHyIDBQuoteInfoUnannouncedUpdateAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteUnannounced_c> m_QList;	//详情
	//DeleteList
	std::list<std::string> m_DeleteList;		//需要删除的记录，用于实时更新
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DISTRIBUTE_LIST_SUBMIT			= 55033,			// 推送、分配							--发送分配结果，包括承/分销商信息，价位，倍数及分配列表（返回空消息）；接收的推送消息，实时更新债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）

//request,response
//E_FID_HY_BOND_DISTRIBUTE_LIST_SUBMIT
//55033,发送分配结果，包括承/分销商信息，价位，倍数及分配列表（返回空消息）；接收的推送消息，实时更新债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）
//xHyIDBDistributeListSubmitReq
class xHyIDBDistributeListSubmitReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//BidQuantity
	double m_BidQuantity;				//无主承销商时的中标量
	//DistributionPrice
	double m_DistributionPrice;			//无主承销商时的分销价格
	//FeeRate
	double m_FeeRate;					//无主承销商时的手续费率
	//MainUnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_MainUnderwriterList;	//主承销商
	//UnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_UnderwriterList;	//分销团
	//TenderingType
	int m_TenderingType;				//招标方式		--0：荷兰式，1：美国式，2：混合式
	//WeightedAveragePrice
	double m_WeightedAveragePrice;		//全场加权平均中标价
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//BidPrice
	double m_BidPrice;	//中标价位
	//BidMultiple
	double m_BidMultiple;	//边际倍数
	//DeliveryType
	int m_DeliveryType;		//交割方式
	//QList
	std::list<xHyIDBQuoteDistribute_c> m_QList;	//报价列表
	xHyIDBDistributeListSubmitReq_c()
	{
		m_BidQuantity = 0.0f;
		m_DistributionPrice = 0.0f;
		m_FeeRate = 0.0f;
		m_BidPrice = 0;
		m_BidMultiple = 0;
		m_TenderingType = 0;
		m_WeightedAveragePrice = 0.0f;
		m_Unit = 0;
		m_DeliveryType = 0;
	}
};

//--55033返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DISINFO_ANNOUNCED_DELETE			= 55034,			// 分配、债券详情、申购					--已公告债券报价信息删除

//request
//E_FID_HY_BOND_DISINFO_ANNOUNCED_DELETE
//55034,宏源已公告债券报价信息删除
//xHyIDBDistributionInfoAnnouncedReq
class xHyIDBDistributionInfoAnnouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UUID
	tcUUID_c m_UUID;		//要删除记录的UUID
	//TraderID
	tcUserID_c m_TraderID;	//当前操作员ID
	xHyIDBDistributionInfoAnnouncedReq_c()
	{
		_InitializeString(m_UUID);
		_InitializeString(m_TraderID);
	}
};

//--55034返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DISINFO_UNANNOUNCED_DELETE		= 55035,			// 债券详情、意向						--未公告债券报价信息删除

//request
//E_FID_HY_BOND_DISINFO_UNANNOUNCED_DELETE
//55035,宏源未公告债券报价信息删除
//xHyIDBDistributionInfoUnannouncedReq
class xHyIDBDistributionInfoUnannouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UUID
	tcUUID_c m_UUID;		//要删除记录的UUID
	//TraderID
	tcUserID_c m_TraderID;	//当前操作员ID
	xHyIDBDistributionInfoUnannouncedReq_c()
	{
		_InitializeString(m_UUID);
		_InitializeString(m_TraderID);
	}
};

//--55035返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PURCHASE							= 55036,			// 申购页面								--已公告债券报价信息

//request
//E_FID_HY_BOND_PURCHASE
//55036,宏源 申购页面（已公告债券报价信息）
//xHyIDBPurchaseReq
class xHyIDBPurchaseReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//StartDate
	time_t m_StartDate;			//查询记录的起始日期
	//EndDate
	time_t m_EndDate;			//查询记录的结束日期
	xHyIDBPurchaseReq_c()
	{
		m_StartDate = 0;
		m_EndDate = 0;
	}
};

//response
//E_FID_HY_BOND_PURCHASE
//55036,宏源 申购页面（已公告债券报价信息）
//xHyIDBPurchaseAck
class xHyIDBPurchaseAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteAnnounced_c> m_QList;	//详情
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_INTENTION							= 55037,			// 意向页面								--未公告债券意向信息

//request
//E_FID_HY_BOND_INTENTION
//55037,宏源 意向页面（未公告债券意向信息）
//xHyIDBIntentionReq
class xHyIDBIntentionReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//StartDate
	time_t m_StartDate;			//查询记录的起始日期
	//EndDate
	time_t m_EndDate;			//查询记录的结束日期
	xHyIDBIntentionReq_c()
	{
		m_StartDate = 0;
		m_EndDate = 0;
	}
};

//response
//E_FID_HY_BOND_INTENTION
//55037,宏源 意向页面（未公告债券意向信息）
//xHyIDBIntentionAck
class xHyIDBIntentionAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//QList
	std::list<xHyIDBQuoteUnannounced_c> m_QList;	//详情
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_TRADER_AUTHORITY						= 55038,			// 后台，交易员权限					--当前登录用户权限

//request
//E_FID_HY_TRADER_AUTHORITY
//55038,宏源交易员权限（当前登录用户权限）
//xHyIDBTraderAuthorityReq
class xHyIDBTraderAuthorityReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UserID
	tcUserID_c m_UserID;									//用户ID
	xHyIDBTraderAuthorityReq_c()
	{
		_InitializeString(m_UserID);
	}
};

//response
//E_FID_HY_TRADER_AUTHORITY
//55038,宏源交易员权限（当前登录用户权限）
//xHyIDBTraderAuthorityAck
class xHyIDBTraderAuthorityAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//Authority
	std::vector<xHyIDBAuthorityItem_c> m_Authority;					//用户权限表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_CONTACT_INFO_REQUEST					= 55039,			// 前台联系方式							--打开页面时请求现有联系方式
//--E_FID_HY_CONTACT_INFO_QBREQ						= 55043,			// QB端显示交易员列表，注册推送

//request
//E_FID_HY_CONTACT_INFO_REQUEST,E_FID_HY_CONTACT_INFO_QBREQ
//55039,55043,向后台请求现有联系方式，空类
//xHyIDBContactInfoReq
class xHyIDBContactInfoReq_c : public xHyIDBMsgBaseClass_c
{
public:
};

//response
//E_FID_HY_CONTACT_INFO_QBREQ
//55039,55043,现有联系方式
//xHyIDBContactInfoAck
class xHyIDBContactInfoAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//ContactInfo
	xHyIDBContactInfo_c m_ContactInfo;			//前台联系信息
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_CONTACT_INFO_SUBMIT					= 55040,			// 前台联系方式							--发送联系方式

//request
//E_FID_HY_CONTACT_INFO_SUBMIT
//55040,发送前台联系方式
//xHyIDBContactInfoSubmitReq
class xHyIDBContactInfoSubmitReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//ContactInfo
	xHyIDBContactInfo_c m_ContactInfo;			//前台联系信息
};
//--55040返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_DISTRIBUTION_FULLINFO_RENEW			= 55041,			// 推送，主界面-承分销					--实时更新债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）

//response
//E_FID_HY_DISTRIBUTION_FULLINFO_RENEW
//55041, 推送，主界面-承分销--实时更新债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）
//xHyIDBDistributionInfoAck
class xHyIDBDistributionInfoAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//BidQuantity
	double m_BidQuantity;				//无主承销商时的中标量
	//DistributionPrice
	double m_DistributionPrice;			//无主承销商时的分销价格
	//FeeRate
	double m_FeeRate;					//无主承销商时的手续费率
	//MainUnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_MainUnderwriterList;	//主承销商
	//UnderwriterList
	std::list<xHyIDBUnderwriterBidQuantity_c> m_UnderwriterList;	//分销团
	//TenderingType
	int m_TenderingType;				//招标方式		--0：荷兰式，1：美国式，2：混合式
	//WeightedAveragePrice
	double m_WeightedAveragePrice;		//全场加权平均中标价
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位 /*3:利差(%)，QB2.6，add by Lance*/
	//BidPrice
	double m_BidPrice;	//中标价位
	//BidMultiple
	double m_BidMultiple;	//边际倍数
	xHyIDBDistributionInfoAck_c()
	{
		m_BidQuantity = 0.0f;
		m_DistributionPrice = 0.0f;
		m_FeeRate = 0.0f;
		m_TenderingType = 0;
		m_WeightedAveragePrice = 0.0f;
		m_Unit = 0;
		m_BidPrice = 0;
		m_BidMultiple = 0;
	}
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_DISTRIBUTION_FULLINFO_REQUEST			= 55042,			// 主界面-承分销						--获取所有债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）
//--发送空消息进行请求

//response
//E_FID_HY_DISTRIBUTION_FULLINFO_REQUEST
//55042, 主界面-承分销--获取所有债券的分配信息（包括承销团信息、中标价格、边际倍数。目前主要使用中标价格进行显示）
//xHyIDBDistributionFullInfoAck
class xHyIDBDistributionFullInfoAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//DFList
	std::list<xHyIDBDistributionInfoAck_c> m_DFList;				//所有信息列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_BATCH_QUOTE_ANNOUNCED				= 55044,			// 报价窗体								--对单一债券的批量报价

//request
//E_FID_HY_BOND_BATCH_QUOTE_ANNOUNCED
//55044，报价窗体，对单一债券的批量报价
//xHyIDBBatchQuoteAnnouncedReq
class xHyIDBBatchQuoteAnnouncedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//Unit
	int			m_Unit;							//报价单位 --	1:收益率(%),2:全价(元)
	//QuoteList
	std::vector<xHyIDBBatchQuoteListItem_c> m_QuoteList;			//报价列表
	//BCCompanyID
	tcUnderwriterID_c m_BCCompanyID;			//机构ID
	//BCUserID
	tcUserID_c	m_BCUserID;						//联系人ID
	//BCTraderID
	tcUserID_c	m_BCTraderID;					//交易员ID
	//Remarks
	char		m_Remarks[64];					//备注
	//QBUser
	xHyIDBQuoteQBUserInfo_c	m_QBUser;			//QB上的用户与机构信息
	//PurType
	/*******
	 申购操作类型：
			  0：单券批量申购，单笔校验是否出错，错的不入库，无错误入库；
			  1：单券单笔拆单：出错后所有的拆单报价全部不入库，并返回错误；
	****/
	int    m_PurType;

	//FunctionBegin
	//初始值
	xHyIDBBatchQuoteAnnouncedReq_c()
	{
		_InitializeString(m_BCCompanyID);
		_InitializeString(m_BCUserID);
		_InitializeString(m_BCTraderID);
		_InitializeString(m_Remarks);
		m_Unit = 0;
		m_PurType = 0;
	}
	//FunctionEnd
};

//response
//E_FID_HY_BOND_BATCH_QUOTE_ANNOUNCED
//55044：批量申购返回
//xHyIDBBatchQuoteAnnouncedAck_c
class xHYIDBBatchQuoteAnnouncedErrInfo_c
{
public:
      //ErrCode:申购/修改 报价时返回使用,错误
      /***返回的错误编号
      enum ss_errno_no {
         SS_ERRNO_OK = 0,
         SS_ERRNO_PARAM,
         SS_ERRNO_NOMEM,
         SS_ERRNO_INNER,
         SS_ERRNO_DUP_CONFIRM,
         SS_ERRNO_OUTOFDATE_CONFIRM,
         SS_ERRNO_DUP_QB_QUOTE       //重复报价
      };
      ******/
      int m_ErrCode;
      tcBondKey_c m_BondKey;                             //bondkey
      //ListedMarket
      tcListedMarket_c m_ListedMarket;                //市场
      //UnderwriterID
      tcUnderwriterID_c m_UnderwriterID;
      //UUID
      tcUUID_c m_UUID;
      //BidCoupon
      char         m_BidCoupon[12];
      //BCTraderID
      tcUserID_c   m_BCTraderID;                   //交易员ID
	  
	  xHYIDBBatchQuoteAnnouncedErrInfo_c()
	  {
			m_ErrCode = 0;
			_InitializeString(m_UUID);
			_InitializeString(m_BondKey);
			_InitializeString(m_ListedMarket);
			_InitializeString(m_UnderwriterID);
			_InitializeString(m_BidCoupon);
			_InitializeString(m_BCTraderID);
	  }
};

class xHyIDBBatchQuoteAnnouncedAck_c:public xHyIDBQuoteInfoAnnouncedUpdateAck_c
{
public:
      //ErrList
      std::list<xHYIDBBatchQuoteAnnouncedErrInfo_c> m_ErrList;
};

//--55044返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_DELAY_PUBLICATION					= 55045,			// 推迟发行状态变更(主界面)				--债券推迟发行/取消推迟发行

//request
//E_FID_HY_BOND_DELAY_PUBLICATION
//推迟发行状态变更(主界面)，债券推迟发行/取消推迟发行
//xHyIDBDelayPublicationReq
class xHyIDBDelayPublicationReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;			//主键
	//DelayPublication
	int m_DelayPublication;			//推迟发行标志 0:取消推迟 1:推迟
	//FunctionBegin
	//初始值
	xHyIDBDelayPublicationReq_c()
	{
		m_DelayPublication = 0;
	}
	//FunctionEnd
};

//--55044返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_CLIENT_LIST						= 55050,			// 主界面-已公告，未公告				--客户端登录时获取全量机构信息

//request
//E_FID_HY_BOND_CLIENT_LIST
//55050,空类，主界面-已公告，未公告,客户端登录时获取全量机构信息
//xHyIDBClientListReq
class xHyIDBClientListReq_c : public xHyIDBMsgBaseClass_c
{
};

//response
//E_FID_HY_BOND_CLIENT_LIST
//55050,主界面-已公告，未公告,客户端登录时获取全量机构信息
//xHyIDBClientListAck
class xHyIDBClientListAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::vector<xHyIDBClientInstitutionInfo_c> m_List;		//机构信息列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH_INFO_LIST					= 55051,			// 主界面-已公告，未公告				--获取全量债券推送设定列表

//request
//E_FID_HY_BOND_PUSH_INFO_LIST
//55051,空类，主界面-已公告，未公告,获取全量债券推送设定列表
//xHyIDBPushInfoListReq
class xHyIDBPushInfoListReq_c : public xHyIDBMsgBaseClass_c
{
};

//response
//E_FID_HY_BOND_PUSH_INFO_LIST
//55051,主界面-已公告，未公告,获取全量债券推送设定列表
//xHyIDBPushInfoListAck
class xHyIDBPushInfoListAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::vector<xHyIDBPushInfo_c> m_List;					//债券推送信息列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH_INFO_MODIFIED				= 55052,			// 主界面-已公告，未公告				--债券推送设定变更

//request
//E_FID_HY_BOND_PUSH_INFO_MODIFIED
//55052,主界面-已公告，未公告,债券推送设定变更
//xHyIDBPushInfoModifiedReq
class xHyIDBPushInfoModifiedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PushInfo
	xHyIDBPushInfo_c m_PushInfo;
};

//--55052返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH_INFO_AUTO					= 55053,			// 主界面-已公告，未公告，推送			--债券推送设定实时更新

//response
//E_FID_HY_BOND_PUSH_INFO_AUTO
//55053,主界面-已公告，未公告，推送,债券推送设定实时更新
//xHyIDBPushInfoAutoAck
class xHyIDBPushInfoAutoAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//PushInfo
	xHyIDBPushInfo_c m_PushInfo;
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_AUCTION_INFO_LIST					= 55060,			// 编辑-已公告							--获取全量债券标位设置列表
/*
//inner
//
//债券标位设置数据类
//xHyIDBAuctionData
class xHyIDBAuctionData_c
{
public:
	//AuctionSet
	int m_AuctionSet;		//标志位	--	0:标位未设置,1:标位已设置；指明当前结构是否已设置有效值
	//Unit
	int			m_Unit;							//单位		--	1:收益率(%),2:全价(元),0:未设定单位
	//AuctionFlr
	double m_AuctionFlr;	//下限
	//AuctionCap
	double m_AuctionCap;	//上限（上下限相等则为中间值）
	//Step
	double m_Step;			//步长
	//FunctionBegin
	//初始值
	xHyIDBAuctionData_c()
	{
		m_AuctionSet	= 0;
		m_Unit			= 0;
		m_AuctionFlr	= 0.0f;
		m_AuctionCap	= 0.0f;
		m_Step			= 0.0f;
	}
	xHyIDBAuctionData_c& operator=(const xHyIDBAuctionData_c &inItem)
	{
		m_AuctionSet	= inItem.m_AuctionSet	;
		m_Unit			= inItem.m_Unit		;		
		m_AuctionFlr	= inItem.m_AuctionFlr	;
		m_AuctionCap	= inItem.m_AuctionCap	;
		m_Step			= inItem.m_Step		;	
		return *this;
	}
	//FunctionEnd
};

//inner
//
//债券标位设置结构类
//xHyIDBAuctionStruct
class xHyIDBAuctionStruct_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;						//主键
	//AuctionData
	xHyIDBAuctionData_c m_AuctionData;			//标位设置
	//FunctionBegin
	//初始值
	xHyIDBAuctionStruct_c& operator=(const xHyIDBAuctionStruct_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;
		m_PK			= inItem.m_PK			;
		m_AuctionData	= inItem.m_AuctionData	;		
		return *this;
	}
	//FunctionEnd
};

//request
//E_FID_HY_BOND_AUCTION_INFO_LIST
//55060,			// 编辑-已公告							--获取全量债券标位设置列表；空类
//xHyIDBAuctionInfoListReq
class xHyIDBAuctionInfoListReq_c : public xHyIDBMsgBaseClass_c
{
};

//response
//E_FID_HY_BOND_AUCTION_INFO_LIST
//55060,			// 编辑-已公告							--获取全量债券标位设置列表
//xHyIDBAuctionInfoListAck
class xHyIDBAuctionInfoListAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::vector<xHyIDBAuctionStruct_c> m_AuctionInfoList;	//标位设置列表
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_AUCTION_INFO_MODIFIED				= 55061,			// 编辑-已公告							--债券标位设置变更

//request
//E_FID_HY_BOND_AUCTION_INFO_MODIFIED
//55061,			// 编辑-已公告							--债券标位设置变更
//xHyIDBAuctionInfoModifiedReq
class xHyIDBAuctionInfoModifiedReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//AuctionInfo
	xHyIDBAuctionStruct_c m_AuctionInfo;				//标位设置
};

//--55061返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_AUCTION_INFO_AUTO					= 55062,			// 编辑-已公告，推送					--债券标位设置实时更新

//response
//E_FID_HY_BOND_AUCTION_INFO_AUTO
//55062,			// 编辑-已公告，推送					--债券标位设置实时更新
//xHyIDBAuctionInfoAutoAck
class xHyIDBAuctionInfoAutoAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//AuctionInfo
	xHyIDBAuctionStruct_c m_AuctionInfo;				//标位设置
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_AUCTION_INFO_DEFAULT				= 55063,			// 编辑-已公告							--获取债券默认标位设置

//request
//E_FID_HY_BOND_AUCTION_INFO_DEFAULT
//55063,			// 编辑-已公告							--获取债券默认标位设置
//xHyIDBAuctionInfoDefaultReq
class xHyIDBAuctionInfoDefaultReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//PK
	xHyIDBBondPK_c m_PK;						//主键
};

//response
//E_FID_HY_BOND_AUCTION_INFO_DEFAULT
//55063,			// 编辑-已公告							--获取债券默认标位设置
//xHyIDBAuctionInfoDefaultAck
class xHyIDBAuctionInfoDefaultAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//AuctionInfo
	xHyIDBAuctionStruct_c m_AuctionInfo;				//标位设置
};
*/
//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_RECOMMENDED_QUERY	 = 55100,	 // 主界面	 --查询推荐债券列表（五支） 

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_RECOMMENDED_SET	 = 55101,	 // 主界面，推送							--推荐与取消推荐债券，每次一支。服务器接到此消息后，返回成功或者失败，成功的同时更新行情。

//request
//E_FID_HY_BOND_RECOMMENDED_SET
//55101,主界面，推送--推荐与取消推荐债券，每次一支。
//xHyIDBBondRecommendedSetReq
class xHyIDBBondRecommendedSetReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//Recommended
	int m_Recommended;			//0：取消推荐，1：推荐
	//PK
	xHyIDBBondPK_c m_PK;		//债券主键
	//FunctionBegin
	//初始值
	xHyIDBBondRecommendedSetReq_c()
	{
		m_Recommended = 0;
	}
	//FunctionEnd
};

//--55101返回值为空，从msgHead中的错误信息号是否为0判断是否成功

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_RECOMMENDED_QUERY_SUMSCOPE		= 55110,			// 主界面								--查询Sumscope推荐债券列表（QB使用，承分销端不使用，视需求变更）

//inner
//
//推荐债券的内部类，包括BondKey,ListedMarket和排序用字段
//xHyIDBBondRecommendedInfo
class xHyIDBBondRecommendedInfo_c
{
public:
	//Id
	tcUUID_c		m_Id;						//记录ID
	//bond_key
	tcBondKey_c		m_BondKey;				//bondkey
	//listed_market
	tcListedMarket_c m_ListedMarket;				//市场
	//sort
	int m_Order;			//顺序
	//FunctionBegin
	//初始值
	xHyIDBBondRecommendedInfo_c()
	{
		_InitializeString(m_Id);
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		m_Order = 0;
	}
	bool operator==(const xHyIDBBondRecommendedInfo_c &inItem) const
	{
		return strcmp(m_Id, inItem.m_Id)==0;
	}
	bool Equal(const xHyIDBBondRecommendedInfo_c &inItem)
	{
		return strcmp(m_Id, inItem.m_Id)==0;
	}
	xHyIDBBondRecommendedInfo_c& operator=(const xHyIDBBondRecommendedInfo_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;
		_Copy_String_From_inItem(m_Id);
		_Copy_String_From_inItem(m_BondKey);
		_Copy_String_From_inItem(m_ListedMarket);
		m_Order = inItem.m_Order;
		return *this;
	}
	//FunctionEnd
};


//request
//E_FID_HY_BOND_RECOMMENDED_QUERY_SUMSCOPE
//55110,主界面--查询Sumscope推荐债券列表（QB使用，承分销端不使用，视需求变更）；此处不需要赋值UnderwriterID
//xHyIDBBondRecommendedQuerySumscopeReq
typedef xHyIDBMsgBaseClass_c xHyIDBBondRecommendedQuerySumscopeReq_c;

//response
//E_FID_HY_BOND_RECOMMENDED_QUERY_SUMSCOPE
//55110,主界面--查询Sumscope推荐债券列表（QB使用，承分销端不使用，视需求变更）；此处不需要赋值UnderwriterID
//xHyIDBBondRecommendedQuerySumscopeAck
class xHyIDBBondRecommendedQuerySumscopeAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List 
	std::list<xHyIDBBondRecommendedInfo_c> m_List;	 //推荐债券列表 
};

//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_RECOMMENDED_AUTO_SUMSCOPE			= 55111,			// 主界面，推送							--广播更新Sumscope推荐债券列表（QB使用，承分销端不使用，视需求变更）

//response
//E_FID_HY_BOND_RECOMMENDED_AUTO_SUMSCOPE
//55111,主界面，推送--广播更新Sumscope推荐债券列表（QB使用，承分销端不使用，视需求变更）；每次均全量更新
//xHyIDBBondRecommendedAutoSumscopeAck
class xHyIDBBondRecommendedAutoSumscopeAck_c
{
public:
	//type
	std::string	m_Type;			//操作类型
	//old
	xHyIDBBondRecommendedInfo_c	m_OldRecord;		//旧数据
	//new
	xHyIDBBondRecommendedInfo_c	m_NewRecord;		//新数据
	//FunctionBegin
	//初始值
	xHyIDBBondRecommendedAutoSumscopeAck_c()
	{
		m_Type = "";
	}
	//FunctionEnd
};

//-------------------------------------------------------------------------------------
//E_FID_HY_BOND_QUOTATION_HIS_REQ					= 55120,			// 历史行情查询，add by lance 2016.3.2
//request
class xHyBondQuotationHisReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//bd
	int	m_BeginDate;	//查询历史开始日期，包含该日，当BeginDate=0时，从最早开始查（maybe 19700101）
	//ed
	int m_EndDate;		//查询历史结束日期，包含该日，当EndDate=0时，查询至最新，当BeginDate=0 && EndDate=0时，查询全量历史
	xHyBondQuotationHisReq_c()
		:xHyIDBMsgBaseClass_c(){
		m_BeginDate = 0;
		m_EndDate = 0;
	}
};
//response 同55020

//-------------------------------------------------------------------------------------
//E_FID_HY_BOND_MYPURCHASE_REQ				= 55200,			// 宏源、我的申购请求
//request
//xHyIDBMyPurchaseReq
class xHyIDBMyPurchaseReq_c : public xHyIDBMsgBaseClass_c
{
public:
	tcUserID_c			m_UserId;			//用户id
	tcUnderwriterID_c	m_CompanyID;		//用户所在机构I
	//初始值
	xHyIDBMyPurchaseReq_c()
	{
		_InitializeString(m_UserId);
		_InitializeString(m_CompanyID);
	}
};

//response
//E_FID_HY_BOND_PURCHASE
//55036,宏源 申购页面（已公告债券报价信息）
//xHyIDBPurchaseAck
//class xHyIDBPurchaseAck_c
//{
//public:
//	//QList
//	std::list<xHyIDBQuoteAnnounced_c> m_QList;	//详情
//};
//-------------------------------------------------------------------------------------
//E_FID_HY_BOND_MYPURPOSE_REQ				= 55201,			// 宏源、我的意向请求
//请求同55200

//response
//E_FID_HY_BOND_INTENTION
//55037,宏源 意向页面（未公告债券意向信息）
//xHyIDBIntentionAck
//class xHyIDBIntentionAck_c
//{
//public:
//	//QList
//	std::list<xHyIDBQuoteUnannounced_c> m_QList;	//详情
//};
//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH							= 55250,			// 宏源推送注册

//request
//E_FID_HY_BOND_PUSH
//宏源推送注册
//xHyIDBRegisterUnderwriterReq
class xHyIDBRegisterUnderwriterReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//RegisterUnderwriterID
	tcUnderwriterID_c m_RegisterUnderwriterID;				//注册的UnderwriterID
	xHyIDBRegisterUnderwriterReq_c()
	{
		_InitializeString(m_RegisterUnderwriterID);
	}
};

//--55250返回值为空，从msgHead中的错误信息号是否为0判断是否成功
//-------------------------------------------------------------------------------------
//--E_FID_HY_BOND_PUSH_CANCEL					= 55251,			// 宏源推送注册取消

//request
//E_FID_HY_BOND_PUSH_CANCEL
//宏源推送注册
//xHyIDBUnregisterUnderwriterReq
class xHyIDBUnregisterUnderwriterReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//UnregisterUnderwriterID
	tcUnderwriterID_c m_UnregisterUnderwriterID;				//注册的UnderwriterID
	xHyIDBUnregisterUnderwriterReq_c()
	{
		_InitializeString(m_UnregisterUnderwriterID);
	}
};

//--55251返回值为空，从msgHead中的错误信息号是否为0判断是否成功
//-------------------------------------------------------------------------------------

//inner
//-------------------------------------------------------------------------------------
//债券ID类
//xIDBBondUID
class xIDBBondUID_c
{
public:
	//BondKey
	std::string		m_BondKey;				//bondkey
	//ListedMarket
	std::string		m_ListedMarket;			//市场
	//FunctionBegin
	//初始值
	xIDBBondUID_c()
		:m_BondKey("")
		,m_ListedMarket("")
	{
	}
	//FunctionEnd
};

typedef std::list<xIDBBondUID_c> LstIDBBondUID;

//区间变动信息类
//xIDBIntervalInfo
class xIDBIntervalInfo_c
{
public:
	//BondKey	
	tcBondKey_c m_BondKey;					//bondkey
	//ListedMarket
	tcListedMarket_c m_ListedMarket;		//市场
	//BidLower
	char		m_BidLower[12];				//投标区间下限
	//BidUpper	
	char		m_BidUpper[12];				//投标区间上限	
	//SuggestLower
	char		m_SuggestLower[12];			//建议区间下限
	//SuggestUpper
	char		m_SuggestUpper[12];			//建议区间上限
	//UnderwriterID
	char		m_UnderwriterID[64];		//机构ID
	//UpdateTime
	time_t		m_UpdateTime;				//更新时间
	//FunctionBegin
	//初始值
	xIDBIntervalInfo_c()
		:m_UpdateTime(0)
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_BidLower);
		_InitializeString(m_BidUpper);
		_InitializeString(m_SuggestLower);
		_InitializeString(m_SuggestUpper);
		_InitializeString(m_UnderwriterID);
	}
	//FunctionEnd
};

typedef std::list<xIDBIntervalInfo_c> LstIDBIntervalInfo;

//-------------------------------------------------------------------------------------
//--E_FID_IDB_QUERY_BOND_INTERVAL_INFO           	    = 55300,            //查询指定债券的区间信息

//55300--request
//xIDBQueryBondIntervalInfoReq
class xIDBQueryBondIntervalInfoReq_c : public xHyIDBMsgBaseClass_c
{
public:
	//LstBondUID
	LstIDBBondUID	m_LstBondUID;			//请求的债券列表
};

//55300--response
//xIDBQueryBondIntervalInfoAck
class xIDBQueryBondIntervalInfoAck_c
{
public:
	//Version
	int				m_Version;				//版本号，20160101，add by Lance 20160122
	//LstIntervalInfo
	LstIDBIntervalInfo m_LstIntervalInfo;	//区间信息返回
};

//55252, //个券详情、一级页面、申购区间请求
// QB请求区间变动消息格式定义如下：
// 请求：
class xBidYieldsReq_c : public xHyIDBMsgBaseClass_c
{ 
public: 
	//BondKey	
	char m_BondKey[33];				//bondkey
	//ListedMarket
	char m_ListedMarket[8];		//市场
	//初始值
	xBidYieldsReq_c()
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
	}
}; 
// 应答：
class xBidYield_c 
{ 
public: 
	//BondKey	
	tcBondKey_c m_BondKey;					//bondkey
	//ListedMarket
	tcListedMarket_c m_ListedMarket;		//市场
	//UnderwriterID
	tcUnderwriterID_c m_UnderwriterID;		//机构ID
	//Type
	int m_Type; //0 无效,1 投标区间，2 建议区间，3 发行结果，4 推迟发行，5 截标时间
	//BidYieldStart
	char m_BidYieldStart[8+1]; //投标区间下限
	//BidYieldEnd
	char m_BidYieldEnd[8+1]; //投标区间上限
	//SuggestLowerLimit
	char m_SuggestLowerLimit[8+1];	//建议投标区间下限
	//SuggestLowerLimit; 
	char m_SuggestUpperLimit[8+1]; //建议投标区间上限
	//DelayPublication
	int m_DelayPublication; //推迟发行
	//AuctionEndTime
	time_t m_AuctionEndTime; //截标时间
	//OperatorID
	tcUserID_c m_OperatorID; //交易员ID
	//UpdateTime
	time_t m_UpdateTime; //更新时间
	//初始值
	xBidYield_c()
	{
		m_Type = 0;
		m_UpdateTime = 0;
		m_DelayPublication = 0;
		m_AuctionEndTime = 0;
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_UnderwriterID);
		_InitializeString(m_BidYieldStart);
		_InitializeString(m_BidYieldEnd);
		_InitializeString(m_SuggestLowerLimit);
		_InitializeString(m_SuggestUpperLimit);
		_InitializeString(m_OperatorID);
	}
}; 

class xBidYieldsAck_c
{ 
public: 
	//BidYieldList
	std::list<xBidYield_c> LstYields; 
};

// 区间变动服务推送给QB消息定义格式
//55253, //个券详情、一级页面、申购区间推送
class xBidYieldsNotify_c
{ 
public: 
	//BidYieldList
	std::list<xBidYield_c> LstYields; 
};

//--E_FID_HY_DEALER_QM_STATUS						= 55068,			// 缓存数据								--实时更新交易员的QM在线状态

//inner
//
//交易员的QM信息
//xHyTraderQMStatus
class xHyTraderQMStatus_c
{
public:
	//UserAccount
	char m_UserAccount[64];		//交易员的QB用户名（QM登录名）
	//QM_ID
	int64_t m_QM_ID;				//QMID
	//QM_Status
	int m_QM_Status;			//QM在线状态。
	//FunctionBegin
	//初始值
	xHyTraderQMStatus_c()
	{
		_InitializeString(m_UserAccount);
		m_QM_ID = 0;
		m_QM_Status = SHOW_UNDEFINE;
	}
	xHyTraderQMStatus_c& operator=(const xHyTraderQMStatus_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;
		_Copy_String_From_inItem(m_UserAccount);
		m_QM_ID= inItem.m_QM_ID;
		m_QM_Status = inItem.m_QM_Status;
		return *this;
	}
	xHyTraderQMStatus_c& operator=(const xHyTraderSimpleInfo_c &inItem)
	{
		_Copy_String_From_inItem(m_UserAccount);
		m_QM_ID= inItem.m_QM_ID;
		m_QM_Status = inItem.m_QM_Status;
		return *this;
	}
	//FunctionEnd
};

//response
//E_FID_HY_DEALER_QM_STATUS
//55068,缓存数据--获取全量和实时更新交易员的QM在线状态
//xHyTraderQMStatusUpdateAck
class xHyTraderQMStatusUpdateAck_c: public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xHyTraderQMStatus_c> m_List;		//所有当前券商的交易员列表
	xHyTraderQMStatusUpdateAck_c(){
		memset(m_UnderwriterID, 0, sizeof(m_UnderwriterID));
	}
};

//--E_FID_HY_UNDERWRITER_SUBSCRIBE					= 55090,			// 一级分销商QM公众号订阅，取消订阅，订阅查询
//request
class xHyUnderwriterSubscribedReq_c
{
public:
	//UserID
	tcUserID_c m_UserID;			//用户ID
	//UserAccount
	char m_UserAccount[64];			//QB用户名（QM登录名）
	//UnderwriterID
	tcUnderwriterID_c m_UnderwriterID;		//当前对应的一级分销商ID。
	//FunctionID
	char m_FunctionID[8];			//功能号，每个功能号对应一个公众号
	//Commond
	int	m_Command;					//动作标志。1=订阅，2=取消订阅，3=查询订阅
	//初始值
	xHyUnderwriterSubscribedReq_c()
	{
		_InitializeString(m_UserID);
		_InitializeString(m_UserAccount);
		_InitializeString(m_UnderwriterID);
		_InitializeString(m_FunctionID);
		m_Command = 0;
	};
};

class xHyUnderwriterSubscribedAck_c
{
public:
	//UserID
	tcUserID_c m_UserID;			//用户ID
	//UserAccount
	char m_UserAccount[64];			//QB用户名（QM登录名）
	//UnderwriterID
	tcUnderwriterID_c m_UnderwriterID;		//当前对应的一级分销商ID。
	//FunctionID
	char m_FunctionID[8];			//功能号，每个功能号对应一个公众号
	//PublishID
	int64_t m_PublishID;				//公众号
	//Commond
	int	m_Command;					//动作标志。1=订阅，2=取消订阅，3=查询订阅
	//RetCode
	int m_RetCode;					//返回标志。1=成功，0=失败
	//初始值
	xHyUnderwriterSubscribedAck_c()
	{
		_InitializeString(m_UserID);
		_InitializeString(m_UserAccount);
		_InitializeString(m_UnderwriterID);
		_InitializeString(m_FunctionID);
		m_PublishID = 0;
		m_Command = 0;
		m_RetCode = 0;
	};
};

//E_FID_HY_UNDERWRITER_SUBSCRIBE_PUSH				= 55091,			// 注册QM推送公众号状态到QB
//无请求结构
//应答结构同 55090

//E_FID_HY_DEALER_PURCHASE_REQ						= 55900,			// 请求一级卖方所有可确认申购
//请求
class xHyDealerPurchaseReq_c: public xHyIDBMsgBaseClass_c
{
public:
	//List
	tcUnderwriterID_c m_InstitutionID;			//卖方机构号
	tcUserID_c m_TraderID;						//联系人ID
	xHyDealerPurchaseReq_c(){
		_InitializeString(m_InstitutionID);
		_InitializeString(m_TraderID);
	};
};
//应答
class xHyDealerPurchaseAck_c:public xHyIDBMsgBaseClass_c
{
public:
	//List
	tcUnderwriterID_c m_InstitutionID;			//卖方机构号
	tcUserID_c m_TraderID;						//联系人ID
	std::list<xHyIDBQuoteAnnounced_c> m_List;	//申购记录
	xHyDealerPurchaseAck_c(){
		memset(m_InstitutionID, 0, sizeof(m_InstitutionID));
		memset(m_TraderID, 0, sizeof(m_TraderID));
	};
};
//E_FID_HY_DEALER_PURCHASE_PUSH					= 55901,			// 注册推送一级卖方所有可确认申购
//请求结构为空
//应答结构同55900

//E_FID_HY_DEALER_PURCHASE_DEAL_REG				= 55903,			// 一级卖方通过QB确认一笔申购
//请求
class xHyDealerPurchaseDealReq_c: public xHyIDBMsgBaseClass_c
{
public:
	//List
	tcUnderwriterID_c m_InstitutionID;			//卖方机构号
	tcUserID_c m_TraderID;						//联系人ID
	xHyIDBQuoteAnnounced_c	m_Quote;			//被确认的申购
	xHyDealerPurchaseDealReq_c(){
		memset(m_InstitutionID, 0, sizeof(m_InstitutionID));
		memset(m_TraderID, 0, sizeof(m_TraderID));
	};
};
//应答
class xHyDealerPurchaseDealAck_c: public xHyIDBMsgBaseClass_c
{
public:
	//List
	tcUnderwriterID_c m_InstitutionID;			//卖方机构号
	tcUserID_c m_TraderID;						//联系人ID
	int  m_Result;								//成功=1，失败=0
	xHyIDBQuoteAnnounced_c	m_Quote;			//被确认的申购
	xHyDealerPurchaseDealAck_c(){
		memset(m_InstitutionID, 0, sizeof(m_InstitutionID));
		memset(m_TraderID, 0, sizeof(m_TraderID));
		m_Result = 0;
	};
};

typedef struct xUserAccountInfo_c
{
	char m_UserAccount[64+1];
	xUserAccountInfo_c(){
		memset(m_UserAccount,0,sizeof(m_UserAccount));
	};
	bool operator==(const xUserAccountInfo_c& userAccountInfo)
	{
		if(strcmp(m_UserAccount,userAccountInfo.m_UserAccount)==0)
			return true;
		else
			return false;
	}
}xUserAccountInfo;

//E_FID_HY_QUOTE_REMIND_INTERVAL_PUSH				= 55906,			//一级市场区间变动提醒推送
//推送应答
class xQBIntervalChangeAck_c
{
public:
	std::list<xUserAccountInfo_c> m_receivers;		//QB账号
	char m_bondName[32];							//不解析
	char m_bondCompKey[32+1+8];						// 债券Key.CIB/SSE/SZE 代表不同的市场
	char m_bondSubType[4];							//不解析
	char m_rateType[8+1];							//不解析
	char m_instituteName[32];						//机构名称

	// 投标区间
	char m_bidLowerLimitPrev[12+1];			//上一次 投标区间下限
	char m_bidUpperLimitPrev[12+1];			//上一次 投标区间上限
	char m_bidLowerLimit[12+1];				//投标区间下限
	char m_bidUpperLimit[12+1];	           //投标区间上限


	// 建议利率区间
	char m_suggestLowerLimitPrev[12+1];		//上一次 建议投标区间下限
	char m_suggestUpperLimitPrev[12+1];		//上一次 建议投标区间上限
	char m_suggestLowerLimit[12+1];			//建议投标区间下限
	char m_suggestUpperLimit[12+1];			//建议投标区间上限


	xQBIntervalChangeAck_c ()
	{
		m_receivers.clear();
		_InitializeString(m_bondName);
		_InitializeString(m_bondCompKey);
		_InitializeString(m_bondSubType);
		_InitializeString(m_rateType);
		_InitializeString(m_instituteName);
		_InitializeString(m_bidLowerLimitPrev);
		_InitializeString(m_bidUpperLimitPrev);
		_InitializeString(m_bidLowerLimit);
		_InitializeString(m_bidUpperLimit);
		_InitializeString(m_suggestLowerLimitPrev);
		_InitializeString(m_suggestUpperLimitPrev);
		_InitializeString(m_suggestLowerLimit);
		_InitializeString(m_suggestUpperLimit);
	}
};

//E_FID_HY_QUOTE_REMIND_CONFIRM_PUSH        = 55907,      //一级市场投标确认提醒推送    
//推送应答
class xQBBidConfirmAck_c
{
public:
	char m_UserAccount[64+1];		//QB用户名
	char m_InstituteName[32];		//机构名称
	char m_BondKey[32+1];          //债券key
	char m_ListedMarket[8];        //发行市场
	char m_BondId[64];				//不解析
	char m_BondShortName[32];      //债券简称
	char m_BidCoupon[12];			//投标票面，
	char m_Vol[12];               //申购量
	//char m_Delivery;              //交割方式,0:上市交割 ； 1: 分销交割；-1：旧的报价，无交割方式
	//SuExType
	int    m_SuExType;            //票面&综收，添加。参见枚举QUOTE_SU_EX_TYPE的定义
	//SuDeliveryType
	int    m_SuDeliveryType;         //上市&分销，添加。参见枚举QUOTE_SU_DELIVERY_TYPE的定义
	//SuReturnType
	int    m_SuReturnType;           //无返&单返&折返
	//ReturnRate
	char   m_ReturnRate[12];         //单返数值
	//UpperLimit
	char   m_UpperLimit[12];         //上限，仅在选择综收时有效
	//Unit
	int    m_Unit;                //单位   -- 1:收益率(%),2:全价(元),0:未设定单位/*3:利差(%)*/
	//ReturnRateUnit
	int	   m_ReturnRateUnit;		//手续费单位

	xQBBidConfirmAck_c()
	{
		_InitializeString(m_UserAccount);
		_InitializeString(m_InstituteName);
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_BondId);
		_InitializeString(m_BondShortName);
		_InitializeString(m_BidCoupon);
		_InitializeString(m_Vol);
		//m_Delivery = -1;
		_InitializeString(m_ReturnRate);
		_InitializeString(m_UpperLimit);
		m_SuExType = 0;
		m_SuDeliveryType = 0;
		m_SuReturnType = 0;
		m_Unit = 0;
		m_ReturnRateUnit = 0;
	}
};

//E_FID_HY_QUOTE_REMIND_OUTCOMME_PUSH         = 55908,      //一级市场分配提醒推送
//推送应答
class xQBBidOutcomeUnit_c
{
public:
	char m_BidCoupon[12];			//投标票面，
	char m_Vol[12];					//申购量
	double m_OutcomeQuantity;		//中标面值
	// SuDeliveryType
	int    m_SuDeliveryType;         //上市&分销，
	//Unit
	int    m_Unit;                //单位   -- 1:收益率(%),2:全价(元),0:未设定单位/*3:利差(%)*/

	xQBBidOutcomeUnit_c():m_OutcomeQuantity(0)
	{
		_InitializeString(m_BidCoupon);
		_InitializeString(m_Vol);
		m_SuDeliveryType = 0;
		m_Unit = 0;
	}
};

class xQBBidOutcomeAck_c
{
public:
	char    m_UserAccount[64+1];		//QB用户名
	char    m_InstituteName[32];		//机构名称
	char    m_BondKey[32+1];			//债券key
	char    m_ListedMarket[8];			//发行市场
	char    m_BondId[64];             //不解析
	char    m_BondShortName[32];		//不解析
	char    m_BidPrice[12];				//中标票面，
    std::list<xQBBidOutcomeUnit_c> m_Result;
	xQBBidOutcomeAck_c()
	{
		m_Result.clear();
		_InitializeString(m_UserAccount);
		_InitializeString(m_InstituteName);
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_BondId);
		_InitializeString(m_BondShortName);
		_InitializeString(m_BidPrice);
	}
};

//E_FID_HY_QUOTE_REMIND_DELAYPUBLICATION_PUSH                     = 55909 //推迟发行提醒接口
class xQBDelayPublicationAck_c
{
public:
	char    m_UserAccount[64+1];		//QB用户名
	char    m_InstituteName[32];        //机构名称
	char    m_BondKey[32+1];            //债券key
	char    m_ListedMarket[8];          //发行市场

	xQBDelayPublicationAck_c()
	{
		_InitializeString(m_UserAccount);
		_InitializeString(m_InstituteName);
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
	}
};

//E_FID_HY_QUOTE_REMIND_MARGINALGUIDANCE_PUSH		= 55910,			//一级市场边际指导提醒推送
class xMarginalGuidanceAck_c
{
public:
	char    m_UserAccount[64+1];		//QB用户名
	char    m_InstituteName[32];		//机构名称
	char    m_BondKey[32+1];			//债券key
	char    m_ListedMarket[8];			//发行市场
	char    m_MarginalGuidance[64];    //边际指导
	xMarginalGuidanceAck_c()
	{
		_InitializeString(m_UserAccount);
		_InitializeString(m_InstituteName);
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		_InitializeString(m_MarginalGuidance);
	}
};


//E_FID_QB_QUOTESHARE_FRIEND_CONTACT_REQ			= 55920,			//请求共享报价的好友账号
//请求

typedef xUserAccountInfo xQuoteShareFriendReq_c;

//应答
class xQuoteShareFriendListAck_c
{
public:
	xUserAccountInfo m_UserAccount;
	std::list<xUserAccountInfo> m_FriendList;
};

//E_FID_QB_QUOTESHARE_FRIEND_CONTACT_SET			= 55921,			//设置共享报价的好友账号
//请求
class xQuoteShareFriendSetReq_c
{
public:
	xUserAccountInfo m_UserAccount;
	std::list<xUserAccountInfo> m_AddShareList;//增加的好友，增量增加
	std::list<xUserAccountInfo> m_DelShareList;//删除的好友，增量减少
};

//应答
class xQuoteShareReqAck_c
{
public:
	xUserAccountInfo m_UserAccount;
	int m_ErrCode;		//0 = 成功，其他为错误号
};

//E_FID_QB_QUOTESHARE_UUIDLIST_REQ				= 55922,			//请求共享报价数据	,共享与被共享
//请求
typedef xUserAccountInfo xQuoteShareQuoteListReq_c;

//应答
class xQuoteShareUUID_FromI_c
{
public:
	tcUnderwriterID_c	m_UnderwriterID;
	tcUUID_c			m_UUID;
	std::list<xUserAccountInfo> m_ToAccount;
	xQuoteShareUUID_FromI_c(){
		memset(m_UnderwriterID,0,sizeof(m_UnderwriterID));
		memset(m_UUID,0,sizeof(m_UUID));
	};
};

class xQuoteShareUUID_ToMe_c
{
public:
	tcUnderwriterID_c	m_UnderwriterID;
	tcUUID_c			m_UUID;
	xUserAccountInfo m_FromAccount;		//共享报价的来源
	xQuoteShareUUID_ToMe_c(){
		memset(m_UnderwriterID,0,sizeof(m_UnderwriterID));
		memset(m_UUID,0,sizeof(m_UUID));
	};
};

class xQuoteShareDataAck_c
{
public:
	xUserAccountInfo m_UserAccount;
	std::list<xQuoteShareUUID_FromI_c> m_MyShareList;	//我发起的共享报价UUID
	std::list<xQuoteShareUUID_ToMe_c> m_Share2MeList;	//我被共享报价的UUID
};

//E_FID_QB_QUOTESHARE_UUIDLIST_PUSH			= 55923,			//注册推送被共享报价数据 UUID
//无需注册，服务器直接推送
class xQuoteShareUUID_c
{
public:
	tcUnderwriterID_c	m_UnderwriterID;
	tcUUID_c			m_UUID;		//被共享的报价UUID
	xQuoteShareUUID_c(){
		memset(m_UnderwriterID,0,sizeof(m_UnderwriterID));
		memset(m_UUID,0,sizeof(m_UUID));
	};
};

class xQuoteShareAnnounced_c : public xHyIDBQuoteAnnounced_c{
public:
	tcUnderwriterID_c m_UnderwriterID;
	xQuoteShareAnnounced_c(){
		memset(m_UnderwriterID,0,sizeof(m_UnderwriterID));
	};
};

class xQuoteSharePushUUIDList_c
{
public:
	int m_Operation;    //1 = add，2 = del，3 = modift，其他 = 无效
	xUserAccountInfo m_FromAccount;		//发起共享者
	std::list< xQuoteShareAnnounced_c > m_QuoteList;	//被共享的报价UUID
	std::list< xUserAccountInfo > m_ToAccount;	//接受共享者，增加共享时，ToAccount为新增的共享人； 删除共享时，ToAccount为被删除的共享人；修改共享报价时，ToAccount为所有被共享人；
	xQuoteSharePushUUIDList_c():m_Operation(0){};
};


//E_FID_QB_QUOTESHARE_QUOTEDATA_REQ					= 55924,			//请求被共享报价数据
//请求
class xQuoteShareQuoteDataReq_c{
public:
	xUserAccountInfo	m_UserAccount;		//QB用户名
	std::list<xQuoteShareUUID_c> m_List;	//被共享的报价UUID，需服务器验证用户是否被共享
};

//应答
class xQuoteShareQuoteDataAck_c{
public:
	xUserAccountInfo	m_UserAccount;
	char m_UnderwriterID[32+1];				//机构ID
	std::list<xHyIDBQuoteAnnounced_c> m_List;
	xQuoteShareQuoteDataAck_c()
	{
		_InitializeString(m_UnderwriterID);
	}
};

//E_FID_QB_QUOTESHARE_LAUNCH_REQ			= 55925,			//发起报价共享
//请求
class xQuoteShareLaunchReq_c
{
public:
	xUserAccountInfo m_UserAccount;		//发起人Account
	std::list<xQuoteShareUUID_c> m_ShareQuoteList;		//被共享的报价
	std::list<xUserAccountInfo> m_AddList;	//新增被共享人
	std::list<xUserAccountInfo> m_DelList;	//删除被共享人
};

//应答 class xQuoteShareReqAck_c

//当前热卖券
//E_FID_HY_QUOTE_HOTSALE_BOND_REQ = 55940				//请求热卖券全量
//请求:只需要发送消息号，不用带数据
//应答
class xHotSaleBond_c
{
public:
	//BondKey
	char    m_BondKey[32+1];				//债券key
	//ListedMarket
	char    m_ListedMarket[8];				//发行市场
	//PurchaseAmount
	int     m_PurchaseAmount;				//申购总量

	xHotSaleBond_c()
	{
		_InitializeString(m_BondKey);
		_InitializeString(m_ListedMarket);
		m_PurchaseAmount = 0;
	}
};

class xHyHotSaleBondListAck_c
{
public:
	//InterestDebet
	std::list<xHotSaleBond_c> m_InterestRateList;  //利率债
	//CreditDebet
	std::list<xHotSaleBond_c> m_CreditList;        //信用债
	//InterestDebet
	std::list<xHotSaleBond_c> m_PrivateDebetList;	//私募债
};

//请求：E_FID_HY_QUOTE_HOTSALE_BOND_PUSH	= 55941		 //热卖券推送
typedef xHyHotSaleBondListAck_c xHyHotSaleBondListPush_c;

//-----------------------------------------------------------------------------------
//E_FID_QB_BONDCOP_ACCOUNT_MANAGER_REQ		= 50144,			// 请求机构二级联系人，宏源热卖
//请求同55009
//应答
//xBondCopTraderInfo_c
class xBondCopTraderInfo_c
{
public:
	//UID
	char m_UserID[32+1];
	//Name_en
	char m_Name_en[64];
	//Name_cn
	char m_Name_cn[64];
	//Name_cn_yp_short
	char m_Name_cn_yp_short[256];
	//Name_cn_yp_full
	char m_Name_cn_yp_full[256];
	//UserAccount
	char m_UserAccount[64];		//QB用户名（QM登录名）
	//Mobile
	char m_Mobile[32+1];//移动电话
	//Tel
	char m_Tel[32+1];//固话
	//Email
	char m_Email[32+1];//email
	//Dpt
	char m_Department[45+1];//部门
	//QM_ID
	int64_t m_QM_ID;			//QMID
	//QM_Status
	int m_QM_Status;			//QM在线状态。
	//FunctionBegin
	//初始值
	xBondCopTraderInfo_c()
	{
		_InitializeString(m_UserID);
		_InitializeString(m_Name_en);
		_InitializeString(m_Name_cn);
		_InitializeString(m_Name_cn_yp_short);
		_InitializeString(m_Name_cn_yp_full);
		_InitializeString(m_UserAccount);
		_InitializeString(m_Mobile);
		_InitializeString(m_Tel);
		_InitializeString(m_Email);
		_InitializeString(m_Department);
		m_QM_ID = 0;
		m_QM_Status = SHOW_UNDEFINE;
	}
	xBondCopTraderInfo_c& operator=(const xBondCopTraderInfo_c &inItem)
	{
		if(this==&inItem)//add bushion.xin
			return *this;

		_Copy_String_From_inItem(m_UserID);
		_Copy_String_From_inItem(m_Name_en);
		_Copy_String_From_inItem(m_Name_cn);
		_Copy_String_From_inItem(m_Name_cn_yp_short);
		_Copy_String_From_inItem(m_Name_cn_yp_full);
		_Copy_String_From_inItem(m_UserAccount);
		_Copy_String_From_inItem(m_Mobile);
		_Copy_String_From_inItem(m_Tel);
		_Copy_String_From_inItem(m_Email);
		_Copy_String_From_inItem(m_Department);
		m_QM_ID = inItem.m_QM_ID;
		m_QM_Status = inItem.m_QM_Status;
		return *this;
	}
	//FunctionEnd
};
//xBondCOPAccountManagerAck_c
class xBondCOPAccountManagerAck_c : public xHyIDBMsgBaseClass_c
{
public:
	//List
	std::list<xBondCopTraderInfo_c> m_List;		//所有当前券商的交易员列表
};

//E_FID_QB_QMI_EXCHANGE_SCORE_REQ				= 50305,			//Q米积分
//请求
//xQMiExchangeScoreReq_c
class xQMiExchangeScoreReq_c
{
public:
public:
	//UserID
	tcUserID_c m_UserId;           //用户ID 
	//UserAccount
	char m_UserAccount[64];        //QB用户名（QM登录名）
};

//应答
//xQMiExchangeScoreAck_c
class _xQMiScoreFlow_c
{//积分流水
public:
	//Date
	int m_Date;  //积分流水时间，8位数字
	// Source
	char m_Source[256]; //来源
	// Score
	int m_Score;   //积分,有正：增加，负：已兑换
	// MaturityDate
	int m_MaturityDate; //到期日,8位数字
};

class xQMiExchangeScoreAck_c
{
public:
	//UserID
	tcUserID_c m_UserId; //用户id
	//UserAccount
	char m_UserAccount[64];        //QB用户名（QM登录名）
	//TotalScore
	int m_TotalScore;      //总的Q米积分
	//InvalidDate
	int m_InvalidDate;     //失效日期，年月日，8位数字
	//InvalidateScore
	int m_InvalidScore;    //失效日期之后将失效的积分
	//FlowList
	std::list<_xQMiScoreFlow_c> m_FlowList;  //积分流水
};

//E_FID_QB_QMI_EXCHANGE_SCORE_PUSH = 50306,			//Q米积分变化，针对单个用户
//请求同xQMiExchangeScoreReq_c
typedef xQMiExchangeScoreReq_c xQMiExchangeScorePush_c;
//应答同xQMiExchangeScoreAck_c

//E_FID_QB_QMI_EXCHANGE_SCORE_PUSH_CANCEL = 50307,			//Q米积分变化取消注册，针对单个用户
//请求同xQMiExchangeScoreReq_c
typedef xQMiExchangeScoreReq_c xQMiExchangeScorePushCancel_c;
//无应答，不推送


//E_FID_QB_BID_DOC_REQ				= 50320,			//标书请求
//请求
//xBidDocReq_c

class xBidDocReq_c
{
public:
	//Announcement_Type
	char m_AnnouncementType[32];
	//Bond_Key
	tcBondKey_c		m_BondKey;				//bondkey
};

class xBidDocInstuItem_c
{
public:
	//Announcement_Type
	char m_AnnouncementType[16+1];
	//BondKey
	tcBondKey_c		m_BondKey;				//bondkey
	//Announcement_Source
	char m_AnnouncementSource[10+1];		//卖方机构代码
};

//应答
//xBidDocAck_c
class xBidDocAck_c
{
public:
	//List
	std::list<xBidDocInstuItem_c> m_List;
};

//推送:E_FID_QB_BID_DOC_PUSH = 50321,			//标书请求
class xBidDocPush_c
{
public:
	//type:"DELETE","INSERT","UPDATE"
	char m_type[16];  
	//old
	xBidDocInstuItem_c m_old;
	//new
	xBidDocInstuItem_c m_new;
};
//-------------------------------------------------------------------------------------

enum BondMainUnderwriterNoticeUpdateType
{
	BMUN_DEFAULT = 0,		//新增或更新
	BMUN_DELETE = 1			//删除
};
//inner
//
//
//xUPPCMainUnderwriterNotice
class xUPPCMainUnderwriterNotice_c
{
public:
	//PK
	xHyIDBBondPK_c								m_PK;		//债券主键
	//NoticeID
	std::string m_NoticeID;		//主承公告的ID，用于前后端与数据库中的比对，不显示；PC端输入新的主承公告时，此字段为空
	//MWNotice
	std::string m_MWNotice;		//主承公告内容
	//UpdateTime
	time_t m_UpdateTime;			//更新时间；由后台生成；PC端输入或修改主承公告时，此字段为空
	//DeleteFlag
	int m_DeleteFlag;			//"1：BMUN_DELETE"表示删除；用于后台推送
	xUPPCMainUnderwriterNotice_c& operator=(const xUPPCMainUnderwriterNotice_c &inItem)
	{
		if(this==&inItem)
			return *this;
		m_NoticeID = inItem.m_NoticeID;
		m_MWNotice = inItem.m_MWNotice;
		m_UpdateTime = inItem.m_UpdateTime;
		m_DeleteFlag = inItem.m_DeleteFlag;
		return *this;
	}
	bool operator==(const xUPPCMainUnderwriterNotice_c & inItem)
	{
		return m_NoticeID.compare(inItem.m_NoticeID) == 0;
	}
};
//-------------------------------------------------------------------------------------
//--E_FID_BONDINFO_MAINUNDERWRITER_NOTICE_REQ		= 55950,			//请求债券的主承公告。
//--E_FID_UPPC_MAIN_UNDERWRITER_NOTICE_FANOUT			= 55408,				// 综合平台										--主承公告实时更新
//--E_FID_BONDINFO_MAINUNDERWRITER_NOTICE_FANOUT	= 55951,			//主承公告的实时更新。
//request
//E_FID_BONDINFO_MAINUNDERWRITER_NOTICE_REQ
//55950,请求债券的主承公告。
//xBIMainUnderwriterNoticeGetReq
class xBIMainUnderwriterNoticeGetReq_c
{
public:
	//BondList
	std::list<xHyIDBBondPK_c> m_BondList;	//请求主承公告的债券列表；如果此列表为空，表示获取所有一级市场的债券主承公告
};
//response
//E_FID_BONDINFO_MAINUNDERWRITER_NOTICE_REQ,E_FID_BONDINFO_MAINUNDERWRITER_NOTICE_FANOUT,E_FID_UPPC_MAIN_UNDERWRITER_NOTICE_FANOUT
//55950,请求债券的主承公告。55408,55951,主承公告的实时更新。
//xBIMainUnderwriterNoticeGetAck
class xBIMainUnderwriterNoticeGetAck_c
{
public:
	//NoticeList
	std::list<xUPPCMainUnderwriterNotice_c> m_NoticeList;	//主承公告的列表
};

//-------------------------------------------------------------------------------------
//E_FID_QB_HIS_SINGLE_DEAL_REQ				= 50349,			//个券详情 单券历史 成交信息（高开低收实时行情）-查询
//req
struct xSingleBondQuotationReq_c
{
public:
	//BondKey
	char	BondKey[32 + 1];				//bondkey
	//ListedMarket
	char	ListedMarket[8];				//市场

	char    m_Source[2];                    //来源"c" -CFETS  "b" - BROKER
	xSingleBondQuotationReq_c()
	{
		Clear();
	}
	void Clear()
	{
		memset(this, 0, sizeof(xSingleBondQuotationReq_c));
	}
};
//Ack
struct xSingleBondQuotationAck_c
{
public:
	char	BondKey[32 + 1];//bondkey
	char	ListedMarket[8];//ListedMarket
	char    m_Source[2];	//来源"c" -CFETS  "b" - BROKER

	char	m_Type[5];		//成交方向：0-taken;1-given;2-trade;
	char	m_Price[32];	//最新成交
	char	m_QuoteType[4];	//报价类型，0-有意向；1-净价；2-全价；3-收益率；4-利差
	char	m_Yield[32];	//Yield
	char	m_NetPrice[32];	//NetPrice
	char	m_FullPrice[32];//FullPrice
	
	char	m_PreClose[32];	//昨收
	char	m_Open[32];		//开盘
	char	m_High[32];		//最高
	char	m_Low[32];		//最低
	uint32_t	m_TransCount;	//成交笔数
	time_t	m_time;			//last update

	xSingleBondQuotationAck_c()
	{
		Clear();
	}
	void Clear()
	{
		memset(this, 0, sizeof(xSingleBondQuotationAck_c));
	}
};

//E_FID_QB_HIS_SINGLE_DEAL_REG = 50350,			//个券详情 单券历史 成交信息（高开低收实时行情）-注册
//req
typedef xSingleBondQuotationReq_c xSingleBondQuotationReg_c;
//Ack 
//同50349

//E_FID_QB_HIS_SINGLE_DEAL_UNREG = 50351,			//个券详情 单券历史 成交信息（高开低收实时行情）-取消注册
//req
//同50350
//Ack
//NULL
//-------------------------------------------------------------------------------------

//E_FID_QB_MARKET_DEAL_REQ = 50370,			//多券高开低收行情请求
//请求
struct xQBMarketDealReq
{
	std::list<xSingleBondQuotationReq_c> m_list;
	xQBMarketDealReq(){};
};

//应答
struct xQBMarketDealAck
{
	std::list<xSingleBondQuotationAck_c> m_list;
	xQBMarketDealAck(){};
};
//E_FID_QB_MARKET_DEAL_REG = 50371,			//多券高开低收行情注册
//E_FID_QB_MARKET_DEAL_UNREG = 50372,			//多券高开低收行情取消注册
//请求应答同50370

//-------------------------------------------------------------------------------------
//E_FID_QB_HOT_IDXS_REQ						= 50068,			// 首页-火热指数查询
//req
class xQbHotIdxsReq_c{};
//Ack
class xQbHotIdxsAck_c
{
public:
	char BondIdx[32];
	char CaptialIdx[32];
	char NcdIdx[32];
	time_t tUpdateTime;
	xQbHotIdxsAck_c(){memset(this, 0, sizeof(xQbHotIdxsAck_c));}
};

//E_FID_QB_HOT_IDXS_PUSH = 50069,			// 首页-火热指数推送
typedef xQbHotIdxsAck_c xQbHotIdxsPush_c;
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//E_FID_QB_FI_DEAL_REALTIME_REQ = 50815,			//上证固收实时成交
//req
//NULL
//Ack
class QbFixedIncomeDeal_c
{
public:
	//Id
	char m_Idx[32 + 1];
	//BondKey
	char m_BondKey[32 + 1];	//bondkey
	//ListedMarket
	char m_ListedMarket[8];	//市场
	//NetPrice
	char m_NetPrice[32];	//成交净价
	//FullPrice
	char m_FullPrice[32];	//成交全价
	//YTM
	char m_YTM[32];			//收益率 Yield To Maturity
	//Volume
	char m_Volume[32];		//成交量
	//Amount
	char m_Amount[32];		//成交金额
	//DealTime
	time_t m_tDealTime;		//成交时间 

	QbFixedIncomeDeal_c()
	{
		memset(this, 0, sizeof(QbFixedIncomeDeal_c));
	}
};

class xQbFixedIncomeDealRealTimeAck_c
{
public:
	//List
	std::list<QbFixedIncomeDeal_c> m_List;
};

//E_FID_QB_FI_DEAL_REALTIME_PUSH = 50816,			//上证固收实时成交-推送注册
//E_FID_QB_FI_DEAL_REALTIME_PUSH_CANCEL = 50817,			//上证固收实时成交-取消推送注册
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//E_FID_QB_FI_DEAL_HISTORY_REQ_RAW				= 50818,			//上证固收成交历史请求
//req
class xQbFixedIncomeDealHistoryReq_c
{
public:
	//Begin ->20190202
	uint32_t nBegin;
	//End
	uint32_t nEnd;
	xQbFixedIncomeDealHistoryReq_c()
	{
		nBegin = 0;
		nEnd = 0;
	}
};

//Ack
typedef xQbFixedIncomeDealRealTimeAck_c xQbFixedIncomeDealHistoryAck_c;
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//E_FID_QB_FI_QUOTE_REALTIME_REQ = 50819,			//上证固收报价请求
//req
//NULL
//Ack
struct QbFixedIncomeQuote_c
{
	//Id
	char m_Idx[32 + 1];
	//BondKey
	char m_BondKey[32 + 1];	//bondkey
	//ListedMarket
	char m_ListedMarket[8];	//市场
	//ConversionRate
	char m_ConversionRate[16];//质押率
	//BidInst
	char m_bid_inst[64];
	//BidNetPrice
	char m_bid_net_price[16];
	//BidVolume
	char m_bid_volume[16];
	//BidFullPrice
	char m_bid_full_price[16];
	//BidYtm
	char m_bid_ytm[16];
	//OfrInst
	char m_ofr_inst[64];
	//OfrNetPrice
	char m_ofr_net_price[16];
	//OfrVolume
	char m_ofr_volume[16];
	//OfrFullPrice
	char m_ofr_full_price[16];
	//OfrYtm
	char m_ofr_ytm[16];
	//UpdateTime
	time_t m_tUpdateTime;

	QbFixedIncomeQuote_c()
	{
		memset(this, 0, sizeof(QbFixedIncomeQuote_c));
	}
};

struct xQbFixedIncomeQuoteRealTimeAck_c
{
	std::list<QbFixedIncomeQuote_c> m_List;
};

//E_FID_QB_FI_QUOTE_REALTIME_PUSH = 50820,			//上证固收报价推送-注册
//E_FID_QB_FI_QUOTE_REALTIME_PUSH_CANCEL = 50821,			//上证固收报价推送-反注册
//-------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------
//E_FID_CIB_REPO_REQ							= 50828,			//请求，银行间回购请求
//Req
struct xQbCibRepoReq_c
{
public:
	//Date
	uint32_t m_Date;	//日期：20190905
};

//Ack
struct xQbCibRepo_c
{
	//ID
	char m_szID[32 + 1];		//期限,DR001?需要商榷
	//Rate
	double m_dRate;				//利率
	//Diff
	double m_dDiff;				//变化
	//UpdateTime				
	time_t m_tUpdateTime;			//更新时间

	xQbCibRepo_c()
	{
		memset(this, 0, sizeof(this));
	}
	xQbCibRepo_c(char *pId,double dRate,double dDiff,time_t tUpdateTime)
	{
		__FIELDCOPY__(m_szID, pId);

		m_dRate = dRate;
		m_dDiff = dDiff;
		m_tUpdateTime = tUpdateTime;
	}
};

struct xQbCibRepoAck_c
{
	//List
	std::list<xQbCibRepo_c> m_List;
};
